View Single Post
  #12   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Merging Access data into a Word document

If I have just:
{mergefield MAACTeam} I get either "0" or "-1" depending on whether it
should be "YES" or "NO".


Is this actually -1 for Yes and 0 for No (in which case are you using Word
2000 or earlier and/or connecting using DDE? AFAIK the values Word receives
are as follows:

Connection method "Yes" "No"
DDE -1 0
ODBC 0 1
OLE DB True False

When you say "works for a single record" what are you doing differently? Do
you mean you are connecting to a different data source that only has one
record, are you using the same table/query as the data source in both merges
and changing the query criteria for one of them? Or what? Also, are the
Yes/No results for just

{ mergefield MAACTeam }

always -1 and 0, or do they actually differ depending on whehter you are
doing 1 record or many records?

Also, are you really using "FALSE" rather than "False"? Can we assume that
you have not got commas in your IF field? Do you have a bookmark called
False in your Mail Merge Main Document or any included file? Does it make
any difference if you quote the mergefield, e.g.

{ IF "{ MERGEFIELD MAACTeam }" = "0" "No" "Yes" }

Peter Jamieson


"GaryNSHC" wrote in message
...
My apologies, I am using an IF condition as well as a MERGEFIELD.

The one which works in a single record is:
{IF {mergefield MAACTeam} = "0", "No", "Yes"} and I get "NO"
if I change = "0" to either = "TRUE" or = "FALSE" I get "YES" which is
incorrect.

The one which works for all records is:
{IF {mergefield MAACTeam} = "FALSE", "No", "Yes"} I get either "YES" or
"NO"
if I change = "FALSE" to either = "0" or = "-1" I get "YES" for all
records
which is incorrect.

If I have just:
{mergefield MAACTeam} I get either "0" or "-1" depending on whether it
should be "YES" or "NO".

Hope this clarifies the problem being encountered.

Regards

Gary

"Graham Mayor" wrote:


What exactly does {Mergefield name} produce when inserted without a
condition?

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


GaryNSHC wrote:
I am using this piece of code and am having a little problem with my
mergefields not picking up the correct value for a YES/NO field.

If I use {mergefield name ="false" ...} it doesn't work with single
records but does when I use all records.

BUT ..

When I use {mergefield name = "0" ..} it works for single records but
not for all records.

Whichever way I go, I can't seem to get the word template to pay ball
correctly whether I use a single record or merge all records.

Has anyone else come across this, and if so, how was it resolved?

Regards

Gary

"Doug Robbins - Word MVP" wrote:

See the "Super Easy Word Merge" item at
http://www.members.shaw.ca/AlbertKal.../msaccess.html

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP