Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / June 2004

Tip: Looking for answers? Try searching our database.

Insert text based on name of table?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John Williams - 02 Jun 2004 17:06 GMT
I have a mail merge document which I run separately with 2 data
sources (2 tables from the same Access database).  The document has a
single word which changes depending on which data source table is
being used.

Obviously I can create 2 separate mail merge documents, however I
would like to have just one document with the single word included
depending on the name of the table.

Is it possible to insert text based on the name of the table that the
data is being selected from?

E.g. if the table is Cows, insert the mail merge text 'Milk'
and if the table is Sheep, insert the mail merge text 'Wool'.
Cindy M  -WordMVP- - 03 Jun 2004 15:42 GMT
Hi John,

> I have a mail merge document which I run separately with 2 data
> sources (2 tables from the same Access database).  The document has a
[quoted text clipped - 8 lines]
> data is being selected from?
>  
No, I'm afraid there's no functionality in Word that would let you do
this. Unless you'd use a macro. Then it could work. The exact macro
syntax would depend on the version of Word you're using, and the
connection method to the database.

Or, if the values in a particular field would reflect this, it could
work. I think you should be able to add a column to each query that
would evaluate to the same for each record. Then you could use an IF
field to test that column (field).

Open one of the queries, go to the first empty column in the Design
grid and type in this:
   TableName: "Milk"

Now look at the query result.

> E.g. if the table is Cows, insert the mail merge text 'Milk'
> and if the table is Sheep, insert the mail merge text 'Wool'.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :-)
John Williams - 04 Jun 2004 14:16 GMT
> Or, if the values in a particular field would reflect this, it could
> work. I think you should be able to add a column to each query that
[quoted text clipped - 6 lines]
>
> Now look at the query result.

Thank you Cindy.  That works perfectly.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.