?
Solved

access query results will not show in mail merge document

Posted on 2014-11-25
7
Medium Priority
?
175 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
Industry Leaders: 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 2000 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

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
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 …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

765 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