Form Field - Drop down selection causing auto text

C

chesspupil

I do inspection work on submarines that must be documented. Each Boa
has it own ID code that I would like to appear in another are of th
form based on what boat I select from a Form filed drop down list.


Please see the attachment:

Block one I select a boat in the drop down. In block 2 I would like th
first 5 numbers to automatically appear based on the selection in bloc
1. Currently they are in matching order but it is easy to mis-selec
the wrong 5 digit number if you are not careful or familiar with th
layout.

I have no preference for how its done, just that it works...(VBA o
Macro)

Document file available at:

Code
 
G

Greg Maxey

Say your Dropdown is bookmarked "Name" and your text field for the Unit
Identification Code is bookmarked "UIC." You need to set a macro to run on
exit from the DD.

Sub NameDDOnExit()
Dim oFF As FormFields
Set oFF = ActiveDocument.FormFields
Select Case oFF("Name").Result
Case "TOPEKA"
oFF("UIC").Result = "12345"
Case "PASADENA"
oFF("UIC").Result = "54321"
Case "HELENA"
oFF("UIC").Result = "99999"
End Select
End Sub
 

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