No Recipients When Using a Query to Mail Merge in Word

G

Guest

I designed a query in Access 2003 with several "Like" criteria in order to
sort out people who had participated in an event in any of the last 3 years.
The query worked beautifully in Access, but when I selected it from Word
2003, the recipient list was empty. If I take out the "Like" criteria, Word
displays the recipients, however there are twice as many as I need and I have
to go through and select the ones that I want individually, which defeats the
purpose of the query in the first place. Someone else had this problem, but
I did not find the answers helpful. Please help!
 
G

Guest

How are you defining the criteria for your Like clause, if you are running
this form Word?

Are you using automation?

Dale
 
G

Guest

The person who designed the database created a field for each year and then
placed an X with or without some notes after that to indicate who
participated each year. So I included the last 3 years in my query and
searched for Like "X*" in any of the year fields. So for 2004 I set the
criteria for Like "X*" or Like "X*" in 2005 or Like "X*" in 2006. I hope
that made sense, I am new at this.
 
J

John Spencer

What happens if you try to search just one year? Do you get back records?
What happens if you change the criteria to Is Not Null instead of using Like
"X*"
What happens if you try to search for Like "X%" instead of Like "X*"?


--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
G

Guest

Searching for one year with Like"X*" did not work. But using Is Not Null
worked perfectly for all 3 years! Interestingly enough, when I used Like
"X%" Access did not return any results in the query, but Word displayed them
all anyway with no trouble at all.
 
J

John Spencer

Access SQL uses non-Ansi compliant wildcard characters. Ansi standard for
any number of characters is %, Access uses * (usually). So that is why the
difference in results. From word searching for like "X*" searched for a two
character string consisting of X and an asterisk. Using "X%" searched for X
followed by zero to many characters.



--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

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