Auto select drop down value

B

bryan

On document.new, I am pre-loading fields with info from our host system.
I need to auto select a drop down value based on a value in text1.

For example let's say the drop down list contains
WNA
WNI
PMI

if text1 = '1' then I want to auto select WNI in the drop down

Thanks in advance,
Bryan
 
G

Graham Mayor

You would need something like

Sub OnExitText1()
Dim oFld As FormFields
Set oFld = ActiveDocument.FormFields
Select Case oFld("Text1").Result
Case Is = "1"
oFld("DropDown1").Result = "WNA"
Case Is = "2"
oFld("DropDown1").Result = "WNI"
Case Is = "3"
oFld("DropDown1").Result = "PMI"
Case Else
'Do nothing
End Select
End Sub

with a case statement for each value of Dropdown1 that you wish to load

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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