Macro VBA script to display text

Joined
Mar 25, 2009
Messages
13
Reaction score
0
I need to create a Word macro/vba script to display text to the right of a form field if a particular field value is select from the list of values. I currently have a script (Dropdown8 is a combo box, Text22 is a text box) that works (below), but only changes the text if, after changing the value in Dropdown8, you tab to another field and then reselect it a second time. Can someone help me to figure out what to do so that it(Text22) is updated each time the value in Dropdown8 is changed?

Code:
Sub Dropdown8_Click()
If ActiveDocument.FormFields("Dropdown8").Result = "Ogallala" Then
 
ActiveDocument.FormFields("Text22").Result = "SAR Model Needed"
Else
ActiveDocument.FormFields("Text22").Result = " "
End If
 
Last edited:
Joined
Mar 25, 2009
Messages
13
Reaction score
0
I added
Code:
Application.ScreenUpdating = False
to the beginning of script event, and
Code:
Application.ScreenUpdating = True
to the end of the script event, which works as long as tab out before selecting another value. But, if try to change value (of Dropdown8), without tabbing out, (Text22) does not update.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top