Prev: create a macro that finds certain words in doc then pste - excell
Next: macro to close document if macros disabled
From: dancattransit on 18 Mar 2010 13:06 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
From: Jay Freedman on 18 Mar 2010 13:24
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 |