Add text to a field based on a combo box selection

  • Follow


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 
0
Reply Utf 3/18/2010 5:06:02 PM

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        FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so 
all may benefit.

dancattransit wrote:
> 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 


0
Reply Jay 3/18/2010 5:24:52 PM


1 Replies
610 Views

(page loaded in 0.052 seconds)

8/17/2012 11:28:40 PM


Reply: