Solved

access query results will not show in mail merge document

Posted on 2014-11-25
7
139 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
  • 3
  • 2
  • 2
7 Comments
 
LVL 119

Expert Comment

by:Rey Obrero
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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

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 119

Expert Comment

by:Rey Obrero
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Outlook Free & Paid Tools
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

912 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now