Add text to a field based on a combo box selection

D

dancattransit

I'm making a form that contains a dropdown field (dropdown1) containing 5
possible selections. Based upon what the user selects, I want to fill a
second field (text3) with a corresponding value.

For instance:
If dropdown1="Maintenance" then enter "Jack Doe" text3
If dropdown1="Safety" then enter "Tom Collins" text 3
etc.

Is there a way to write a 'if then else' formula in a 'calculate' form field?
And if so what would the syntax be?

Or is there a better (easier, non-programatic) way to accomplish this?

I'm not a programmer and while I'm learning, I struggle with formula syntax.

Thanks,
Dan


Thanks
 
J

Jay Freedman

You can write an IF field (but not a form field) that works that way, but it
will be pretty complicated because you'd need to nest fields five deep to
handle all the choices in the dropdown. A better solution is to write an
exit macro for the dropdown that fills the text field.

See http://gregmaxey.mvps.org/Linked_DropDown_Fields.htm. The macro that
follows the text "Note: If you simply want to set the value of a single
text field..." is an example of the kind of macro you need to write.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

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