Solved

access query results will not show in mail merge document

Posted on 2014-11-25
7
162 Views
Last Modified: 2014-12-01
Query X produces 10 rows. Word Merge shows 10 rows.
Query Y produces 5 rows. Word Merge shows 0 rows.

Query X and Y are same object, just with different criteria.

The

Anyone else seen this happend before ?
0
Comment
Question by:shelbyinfotech
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40464964
how do you merge "Query Y"?
use the same procedure you used with "Query X"
0
 

Author Comment

by:shelbyinfotech
ID: 40464967
Yes, in fact its the same query, only changing criteria
0
 
LVL 18

Expert Comment

by:Simon
ID: 40464971
Is there any filtering of the data going on withing Word? If the mailmerge document has existing filters they may be excluding all the records returned by Query Y.

It would help if you could describe how your access query results are being used by Word. Are you using the query as the datasource for the merge, or are you passing the query results to Word programatically?

The specific results are being suppressed by a filter in Word is my best guess.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:shelbyinfotech
ID: 40464981
No filters set in Word
0
 
LVL 18

Accepted Solution

by:
Simon earned 500 total points
ID: 40464989
Are you _Sure_ about the filtering in Word. In 2010 at least it is a little odd. You can't revisit the previously defined filters, the dialog appears as blank, but the filters have been added to the query string that you can see if you close and then re-open the merge master document. See attached screenshot.
i.e. the filters are still applied even though the dialog doesn't show any. I've just tested that.

If it was me, and the above wasn't the case, I'd try new query variants to see if I could identify a case where query z returns 20 rows but the corresponding merge produces 1-19 rows. That makes it easier to narrow down the value in a particular record that's causing the glitch.
EE-28569327.jpg
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40465004
upload  a copy of you db
0
 
LVL 18

Expert Comment

by:Simon
ID: 40465021
You might also like to try  this MS Word Macro that prints the datasource fully qualified name and querystring to the immediate window. Useful because Word just tells you the name of the datasource and not the path.
Sub Mailmerge_ListOpenDocsDataSourceAndQueryString()
MsgBox "This lists datasource file path and querystring for each open document to the VBE immediate window", vbInformation
Debug.Print vbCrLf & "Mailmerge_ListOpenDocumentDataSources running @ " & Now()
For Each d In Application.Documents
Debug.Print
d.Activate
If d.MailMerge.DataSource.Name <> "" Then
    Debug.Print d.Name, d.MailMerge.DataSource.Name
    Debug.Print d.Name, d.MailMerge.DataSource.QueryString
Else
    Debug.Print d.Name, "NOT A MAILMERGE DOCUMENT"
End If
Next
Stop
End Sub

Open in new window


To use, go to the Visual Basic Editor in Word, add a new module and then paste this in.

---

If I'm on the wrong track here, please tell us more about how you are doing the merge and how the criteria are set in the queries - are they hardcoded or parameters supplied from a form or elsewhere?
Are both queries in the same database file?
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question