Doral
03-02-2006, 02:41 PM
Hiya folks, I am just starting to learn VBA with no real programming experience ( 2 quarters of PASCAL).
I hope this is the proper area to ask this question
What am I trying to do is use form fields to allow a user to put a date in one field and then it automagically add it to other fields that require the date.
On a macro that will run on entry on the Date 1 form field, I have this so far
Sub CopyField()
Dim Temp As String
Temp = ActiveDocument.FormFields("Date1").Result
ActiveDocument.FormFields("Date2").Result = Temp
End Sub
What I am wondering is if I have to continue to repeat the
"ActiveDocument.FormFields("Date2").Result = Temp" and replace Date2 with Date3, Date4, etc until I have all fields accounted for or is there a way to do it that requires less code? Like I said I'm no programmer but I know least lines of code is best on such things.
Thanks for the help in advance.
I hope this is the proper area to ask this question
What am I trying to do is use form fields to allow a user to put a date in one field and then it automagically add it to other fields that require the date.
On a macro that will run on entry on the Date 1 form field, I have this so far
Sub CopyField()
Dim Temp As String
Temp = ActiveDocument.FormFields("Date1").Result
ActiveDocument.FormFields("Date2").Result = Temp
End Sub
What I am wondering is if I have to continue to repeat the
"ActiveDocument.FormFields("Date2").Result = Temp" and replace Date2 with Date3, Date4, etc until I have all fields accounted for or is there a way to do it that requires less code? Like I said I'm no programmer but I know least lines of code is best on such things.
Thanks for the help in advance.