Merge error when SkipIf added

V

vanessa

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?
 
P

Peter Jamieson

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
 
V

vanessa

Thanks!!!! That did the trick.

- Vanessa

Peter said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top