Solved

access query results will not show in mail merge document

Posted on 2014-11-25
7
134 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:SimonAdept
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

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

Accepted Solution

by:
SimonAdept 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:SimonAdept
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…

758 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

23 Experts available now in Live!

Get 1:1 Help Now