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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional statement in Word

Status
Not open for further replies.

mmasuda

Technical User
Dec 28, 2004
35
US
Is it possible to use nested If-else statements in a mail merge situation in word?
 
How do you do that?
The only thing I know so far is to use the toolbar option where it allows you to insert a single if-else statement. I am sure I will have to add some kind of code somewhere?
 
Where is the merge data coming from? You can nest in Word, but in my experience it is flakey. When I've done merges from Excel or Access, I found it much more reliable to create the nested conditional in the data source application and pass a single criterion to Word.
 
It is coming from Access.
I would have to put the conditions somehow into the queries?
Is it even possible to link to more than one query or table from a single word doc?
I am sure these are very elementary questions but I have never really linked two sources together like that.
I appreciate any input.
thanks.
 
You have to create a single query to pass all of the Access data you need for the merge. If the data exists in more than one table or query, join them in a new query (in Access, a query can be a data source in another query) and add any conditional calculation fields with whatever level of nesting you need. If you don't know about joins in queries and how to use inner and outer joins, you probably should spend a bit of time with the help system (or the manual if you have one -- always remember RTFM). If you're even thinking about nesting conditionals in Word, then joins shouldn't be too hard to master and your database life will be made much more interesting. The same goes for creating calculated conditional fields in queries. Have fun.
 
Yeah, I know how to do the queries. Was hoping though I could get around joining all together. :)
Thanks for the help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top