Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pass-through query for subreport

Status
Not open for further replies.

yuchieh

MIS
Jul 21, 2000
178
US
I tried to use a pass-through query for a subreport and got an error. I found out that pass-through query cannot be used for subreport. Is there a way to work around it? Also, there is filter for the main report and the subreport will display the results based on the filter from the main report.

Thanks
 
Here is something you can try.
Create a Make-Table query using your pass through query as the source. Then create your subreport from the table and set the Master/Child link. You may have to type in the links manually. Access whined a little when I did it, but it ran properly once I did that.
The issue will be refreshing the data. At that point, you can automate the process from a form button with code like this

Private Sub Command2_Click()

DoCmd.SetWarnings False
DoCmd.RunSQL "Select PassThruQueryName.* Into tblPassThru From PassThruQueryName"
Docmd.SetWarnings True
DoCmd.OpenReport "ReportName",acViewPreview

End Sub

That may get you pretty close to what you need.

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top