Reply
 
Thread Tools Display Modes
  #1   Report Post  
vanessa
 
Posts: n/a
Default Merge error when SkipIf added

I have a SkipIf statement in a mail merge document which should skip the
record if the field 'badaddress' is equal to '*'. This is what I have: {
SKIPIF { MERGEFIELD BADADDRESS } = "*" }.

When I do the mail merge, I get this error: Word could not merge the main
document with the data source because the data records were empty or no data
records matched your query options.

I get this error when a merge one record or a batch of records. When I
remove the SkipIf statement, the merge works perfectly. I also tried {
NEXTIF { MERGEFIELD BADADDRESS } = "*" } but I was still getting letters when
'badaddress = *'.

Any suggestions?
  #2   Report Post  
Peter Jamieson
 
Posts: n/a
Default

One reason why this happens because Word treats * and % as "wild card"
characters when it uses the comparison operators = or . However, as far as
I know, it only treats them as wild cards if they are in the second
comparand, i.e. try

{ SKIPIF "*" = { MERGEFIELD BADADDRESS } }

Actually I would probably play safe and use

{ SKIPIF "*" = "{ MERGEFIELD BADADDRESS }" }

but it probably isn't essential.

Peter Jamieson

"vanessa" wrote in message
...
I have a SkipIf statement in a mail merge document which should skip the
record if the field 'badaddress' is equal to '*'. This is what I have: {
SKIPIF { MERGEFIELD BADADDRESS } = "*" }.

When I do the mail merge, I get this error: Word could not merge the main
document with the data source because the data records were empty or no
data
records matched your query options.

I get this error when a merge one record or a batch of records. When I
remove the SkipIf statement, the merge works perfectly. I also tried {
NEXTIF { MERGEFIELD BADADDRESS } = "*" } but I was still getting letters
when
'badaddress = *'.

Any suggestions?



  #3   Report Post  
vanessa
 
Posts: n/a
Default

Thanks!!!! That did the trick.

- Vanessa

Peter Jamieson wrote:
One reason why this happens because Word treats * and % as "wild card"
characters when it uses the comparison operators = or . However, as far as
I know, it only treats them as wild cards if they are in the second
comparand, i.e. try

{ SKIPIF "*" = { MERGEFIELD BADADDRESS } }

Actually I would probably play safe and use

{ SKIPIF "*" = "{ MERGEFIELD BADADDRESS }" }

but it probably isn't essential.

Peter Jamieson

"vanessa" wrote in message
...
I have a SkipIf statement in a mail merge document which should skip the
record if the field 'badaddress' is equal to '*'. This is what I have: {
SKIPIF { MERGEFIELD BADADDRESS } = "*" }.

When I do the mail merge, I get this error: Word could not merge the main
document with the data source because the data records were empty or no
data
records matched your query options.

I get this error when a merge one record or a batch of records. When I
remove the SkipIf statement, the merge works perfectly. I also tried {
NEXTIF { MERGEFIELD BADADDRESS } = "*" } but I was still getting letters
when
'badaddress = *'.

Any suggestions?


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 with attachments AS Mailmerge 5 April 9th 05 09:49 AM
Word Compare and Merge Document Function EricM Microsoft Word Help 2 March 28th 05 11:53 PM
13 numbers added to Word/Excel mail merge field Pat Mailmerge 1 January 19th 05 02:10 AM
Can you create a multi-layered merge where certain merge fields a. mileszat Mailmerge 3 January 18th 05 03:46 AM
can data fields be added to an exisiting mail merge address list missode Microsoft Word Help 1 December 19th 04 11:29 PM


All times are GMT +1. The time now is 11:33 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"