J
Jeff Schneider
Newbie alert!
I've got 2 form fields: Dropdown1 & Text1. I want to populate Text1 based on
what the user selects in the Dropdown1 field. The text is loaded in 8
strings, myText1, myText2... myText8.
So if the user selects "1" from the dropdown, Text1 is populated by the
value of the myText1 string, if the user selects "2", populate Text1 with the
value of myText2 string, etc.
I'm trying to avoid using 8 different If...Then statementrs by using a
For...Next loop. The problem I'm having is identifying each string. How can I
use the For...Next counter to use the corresponding string? (i.e. If I use
"For i = 1 to 8", when i=3 how do use myText3)
Here's my macro:
Public Sub Text1Update()
Dim myText1, myText2, myText3, myText4, myText5, myText6, myText7, myText8
As String
myText1 = "Your request did not include a signed and dated form."
myText2 = "Your request did not include the date."
myText3 = "The additional information requested has not been received,
therefore we must close our files. If submitted we will reconsider the
request."
myText4 = "Reads the same as E3 there is obviously a problem…"
myText5 = "The request did not include an ID number, please include this on
form."
myText6 = "The receipt(s) submitted were less than the amount requested on
your form."
myText7 = "An itemized bill from your service provider showing the name and
address, customer name, itemized charges, type of service, service code and
date of service."
myText8 = "Incomplete statement received. Please resend."
For i = 1 To 8
If ActiveDocument.FormFields("Dropdown1").Result = i Then
ActiveDocument.FormFields("Text1").Result = myText & i 'My problem is
here
End If
Next i
End Sub
I've got 2 form fields: Dropdown1 & Text1. I want to populate Text1 based on
what the user selects in the Dropdown1 field. The text is loaded in 8
strings, myText1, myText2... myText8.
So if the user selects "1" from the dropdown, Text1 is populated by the
value of the myText1 string, if the user selects "2", populate Text1 with the
value of myText2 string, etc.
I'm trying to avoid using 8 different If...Then statementrs by using a
For...Next loop. The problem I'm having is identifying each string. How can I
use the For...Next counter to use the corresponding string? (i.e. If I use
"For i = 1 to 8", when i=3 how do use myText3)
Here's my macro:
Public Sub Text1Update()
Dim myText1, myText2, myText3, myText4, myText5, myText6, myText7, myText8
As String
myText1 = "Your request did not include a signed and dated form."
myText2 = "Your request did not include the date."
myText3 = "The additional information requested has not been received,
therefore we must close our files. If submitted we will reconsider the
request."
myText4 = "Reads the same as E3 there is obviously a problem…"
myText5 = "The request did not include an ID number, please include this on
form."
myText6 = "The receipt(s) submitted were less than the amount requested on
your form."
myText7 = "An itemized bill from your service provider showing the name and
address, customer name, itemized charges, type of service, service code and
date of service."
myText8 = "Incomplete statement received. Please resend."
For i = 1 To 8
If ActiveDocument.FormFields("Dropdown1").Result = i Then
ActiveDocument.FormFields("Text1").Result = myText & i 'My problem is
here
End If
Next i
End Sub