Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
rm51 rm51 is offline
external usenet poster
 
Posts: 1
Default Mail Merge Problem

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?
--
Thanks,
rm51
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Mail Merge Problem

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.

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

"rm51" wrote in message
...
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?
--
Thanks,
rm51


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail merge problem Givvie Mailmerge 9 June 24th 07 03:57 AM
Mail Merge Problem Greg Mailmerge 0 March 9th 06 04:36 PM
mail merge problem JoeWebMan Mailmerge 1 October 6th 05 07:42 PM
Insert Merge Field problem with Word-Mail Merge from Excel documen Augusta E. Microsoft Word Help 2 June 20th 05 10:59 AM
mail merge problem Govind Mailmerge 0 March 7th 05 05:33 AM


All times are GMT +1. The time now is 01:05 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"