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 / December 2007

Tip: Looking for answers? Try searching our database.

Mail Merge Problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rm51 - 03 Dec 2007 18:16 GMT
I have an Access 2003 database that I am merging into Word 2003 documents.  
One of the Access fields is a number field that uses another table to lookup
the values.  When the field is merged, I am getting the Primary Key field
from the lookup table instead of the column I have asked for.  Any idea why
the merge is grabbing the wrong column of my lookup table?
Signature

Thanks,
rm51

Peter Jamieson - 03 Dec 2007 18:39 GMT
It's a while since I have heard this one, but I think the problem is that
the primary key field in the lookup table /is/ the "foreign" key in the main
table whose data you are retrieving. So although the Access user interface
automatically substitutes a value from the lookup table, the OLE DB provider
that Word uses to get the data does not - it just returns the value in the
table you specified, which is actually the primary key value.

I think you will have to write a query in Access that explicitly joins the
two tables, and use that as the data source, to solve this problem - e.g. if
the main table is tablem and the foreign key column name is xm, the lookup
is tablep and the primary key field is xp and the value you actually want is
yp, then something like the following may do the trick:

SELECT m.*, p.yl
FROM tablem m LEFT JOIN tablep p ON m.xm = p.xp

I don't know if it will work but it is probably worth trying.

Signature

Peter Jamieson
http://tips.pjmsn.me.uk

>I have an Access 2003 database that I am merging into Word 2003 documents.
> One of the Access fields is a number field that uses another table to
[quoted text clipped - 3 lines]
> why
> the merge is grabbing the wrong column of my lookup table?
 
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.