shelbyinfotech
asked on
access query results will not show in mail merge document
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 ?
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 ?
ASKER
Yes, in fact its the same query, only changing criteria
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.
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.
ASKER
No filters set in Word
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
upload a copy of you db
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.
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?
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
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?
use the same procedure you used with "Query X"