Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word Form Auto Populate

Status
Not open for further replies.

petunia15

MIS
Jul 13, 2009
3
US
thread68-1458055
Hello
I am trying to be able to choose a location and have address information auto-populate, I have been reviewing a previous question that addresses this, however, when using the code format {IF{REF Dropdown1}= "Blue" "The boy will wear blue if it is sunny outside." {IF{REF Dropdown1}= "Green" "The boy will wear Green if it is Raining Outside" "The boy will stay inside"}}

When I choose my first item, it populates, but my second item won't populate and simply says "if".

Also I will need to populate from at least 3 choices, is there anything different I should do to have have more than 2 choices?
Thank you for your help!
 
Hi petunia,

The field brace pairs (ie '{ }') for your field code examples must be created via Ctrl-F9 (or Insert|Field) - you can't simply type them or copy & paste them from a text description.

For what you're doing, it's probably best to use a series of IF statements, rather than nesting them. For example:
{IF{REF Dropdown1}= "Blue" "The boy will wear blue if it is sunny outside."}
{IF{REF Dropdown1}= "Green" "The boy will wear Green if it is Raining Outside"}
{IF{REF Dropdown1}= "Red" "The boy will wear Red if it is Snowing Outside"}
{IF{REF Dropdown1}= "Black" "The boy will will stay inside"}


Cheers
[MS MVP - Word]
 
Thank you.
Is there a way to nest the IF statements instead? Or can you tell me how I can do a series in a form and have it appear on the same line? I have tried to do individual form lines and the answer shows up on different lines and I get an error message.

Thanks for your help!
 
Hi petunia,

To get the fields to all output on the same line, simply delete the line breaks between them!

And yes, you can nest the fields - it's basically a case of re-arranging them so that you get:
{IF{REF Dropdown1}= "Blue" "The boy will wear blue if it is sunny outside." {IF{REF Dropdown1}= "Green" "The boy will wear Green if it is Raining Outside" {IF{REF Dropdown1}= "Red" "The boy will wear Red if it is Snowing Outside" {IF{REF Dropdown1}= "Black" "The boy will will stay inside"}}}}
or
{IF{REF Dropdown1}= "Blue" "The boy will wear blue if it is sunny outside." {IF{REF Dropdown1}= "Green" "The boy will wear Green if it is Raining Outside" {IF{REF Dropdown1}= "Red" "The boy will wear Red if it is Snowing Outside" "The boy will will stay inside"}}}
which is pretty much what you already had, though I suspect the fact the 'IF' was appearing was because your second IF field wasn't constructed correctly.


Cheers
[MS MVP - Word]
 
Thanks, I was putting the brackets in the wrong spot before, now it works! Thanks for all of your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top