Reply
 
Thread Tools Display Modes
  #1   Report Post  
jameseyryan
 
Posts: n/a
Default If statement problems in mail merge

I have a database in Microsoft Access 2003 which i am linkin to word 2003 via
mail merge.

I want to check the answer given in the access form is "Yes". If it is i
want to put in a value from a different mergefield, if not, a blank value. At
the moment my if statment reads like this:

{ IF { MERGEFIELD OneDependent } = "Yes" "{ MERGEFIELD Child1Forename }" "" }

A value of MERGEFIELD is all that appears. There is data in the database for
the fields: "OneDependent" and also for "Child1Forename". What am i doing
wrong?
  #2   Report Post  
Doug Robbins
 
Posts: n/a
Default

I would do all of the data manipulation with a Query in Access and then use
that Query as the datasource.

However, I think your problem is that you did not use Ctrl+F9 to insert the
field delimiters around the MERGEFIELD Child1Forename

--
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
"jameseyryan" wrote in message
...
I have a database in Microsoft Access 2003 which i am linkin to word 2003
via
mail merge.

I want to check the answer given in the access form is "Yes". If it is i
want to put in a value from a different mergefield, if not, a blank value.
At
the moment my if statment reads like this:

{ IF { MERGEFIELD OneDependent } = "Yes" "{ MERGEFIELD Child1Forename }"
"" }

A value of MERGEFIELD is all that appears. There is data in the database
for
the fields: "OneDependent" and also for "Child1Forename". What am i doing
wrong?



  #3   Report Post  
jameseyryan
 
Posts: n/a
Default

I can't do a query in access to manipulate the data first as the fild
"Child1Forename" is entered into the document more than once. It is needed in
one place but may not in the place I am having this problem with.

As for using CTRL + F9 for the delimiters, I did that too but no luck either.
  #4   Report Post  
Doug Robbins
 
Posts: n/a
Default

That would not preclude you from using a query in Access. You can have the
Child1Forename field in the query as well as any number of conditional
fields that may return the Child1Forename field if the condition is met.

I cannot replicate your problem here when using and If...then...Else field
in a mailmerge main document.

If you want to send me your document, I will take a look at if for you.

--
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
"jameseyryan" wrote in message
...
I can't do a query in access to manipulate the data first as the fild
"Child1Forename" is entered into the document more than once. It is needed
in
one place but may not in the place I am having this problem with.

As for using CTRL + F9 for the delimiters, I did that too but no luck
either.



  #5   Report Post  
Peter Jamieson
 
Posts: n/a
Default

When you get "YesNo" data from Access, the values you see depend on how you
are connecting to your access/jet data file.

If you are using DDE (the default in Word 2000 and earlier), then "Yes"
shows up in Word as "-1" and the "No" as "0"
If you are using OLEDB (the default in Word 2002/2003) the "Yes" shows up as
"True" and "No" as False"
If you are using ODBC, the "Yes" shos up as "1" and the "No" as "0"

So you need to put the right test, depending on how you are connecting, into
your IF field, e.g.

{ IF { MERGEFIELD Child1Forename } = 0 "the 'no' result" "the 'yes'
result" }

unless you're using OLEDB in which case you need


{ IF { MERGEFIELD Child1Forename } = "False" "the 'no' result" "the 'yes'
result" }

Peter Jamieson
"jameseyryan" wrote in message
...
I can't do a query in access to manipulate the data first as the fild
"Child1Forename" is entered into the document more than once. It is needed
in
one place but may not in the place I am having this problem with.

As for using CTRL + F9 for the delimiters, I did that too but no luck
either.





  #6   Report Post  
Doug Robbins
 
Posts: n/a
Default

Another reason for doing the data manipulation in the databaseg

--
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
"Peter Jamieson" wrote in message
...
When you get "YesNo" data from Access, the values you see depend on how
you are connecting to your access/jet data file.

If you are using DDE (the default in Word 2000 and earlier), then "Yes"
shows up in Word as "-1" and the "No" as "0"
If you are using OLEDB (the default in Word 2002/2003) the "Yes" shows up
as "True" and "No" as False"
If you are using ODBC, the "Yes" shos up as "1" and the "No" as "0"

So you need to put the right test, depending on how you are connecting,
into your IF field, e.g.

{ IF { MERGEFIELD Child1Forename } = 0 "the 'no' result" "the 'yes'
result" }

unless you're using OLEDB in which case you need


{ IF { MERGEFIELD Child1Forename } = "False" "the 'no' result" "the 'yes'
result" }

Peter Jamieson
"jameseyryan" wrote in message
...
I can't do a query in access to manipulate the data first as the fild
"Child1Forename" is entered into the document more than once. It is
needed in
one place but may not in the place I am having this problem with.

As for using CTRL + F9 for the delimiters, I did that too but no luck
either.





  #7   Report Post  
Peter Jamieson
 
Posts: n/a
Default

Absolutely.

Peter Jamieson
"Doug Robbins" wrote in message
...
Another reason for doing the data manipulation in the databaseg

--
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
"Peter Jamieson" wrote in message
...
When you get "YesNo" data from Access, the values you see depend on how
you are connecting to your access/jet data file.

If you are using DDE (the default in Word 2000 and earlier), then "Yes"
shows up in Word as "-1" and the "No" as "0"
If you are using OLEDB (the default in Word 2002/2003) the "Yes" shows up
as "True" and "No" as False"
If you are using ODBC, the "Yes" shos up as "1" and the "No" as "0"

So you need to put the right test, depending on how you are connecting,
into your IF field, e.g.

{ IF { MERGEFIELD Child1Forename } = 0 "the 'no' result" "the 'yes'
result" }

unless you're using OLEDB in which case you need


{ IF { MERGEFIELD Child1Forename } = "False" "the 'no' result" "the 'yes'
result" }

Peter Jamieson
"jameseyryan" wrote in message
...
I can't do a query in access to manipulate the data first as the fild
"Child1Forename" is entered into the document more than once. It is
needed in
one place but may not in the place I am having this problem with.

As for using CTRL + F9 for the delimiters, I did that too but no luck
either.







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 - Parameter prompts twice... TL Mailmerge 6 June 17th 05 02:58 PM
Mail Merge - Next Record If Statement HiramPat Mailmerge 5 April 22nd 05 04:03 PM
mail merge with attachments AS Mailmerge 5 April 9th 05 09:49 AM
More Mail Merge Problems dixie Mailmerge 2 February 10th 05 07:15 AM
Using Hyperlinks in Mail Merge IF...THEN...ELSE Statements Mark V Mailmerge 8 November 30th 04 01:31 PM


All times are GMT +1. The time now is 08:51 AM.

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"