Results 1 to 1 of 1
Thread: Open Report
2001-04-05, 14:21 #1
- Join Date
- Jan 2001
- Manchester, Gtr Manchester, England
- Thanked 0 Times in 0 Posts
I have a simple database where a button (cmdPreviewReport) on the data entry form previews a report for the current record only. The code below (essentially that generated by the add command button wizard) works perfectly.
Private Sub cmdPreviewReport_Click()
On Error GoTo Err_cmdPreviewReport_Click
Dim stDocName As String
Dim strFilter As String
stDocName = "rptSites"
strFilter = "RecordID = Forms!frmSites!txtRecordID"
DoCmd.OpenReport stDocName, acPreview, , strFilter
My problem is in a more complicated database where the data source for the report is a query and the report itself contains numerous subreports (each sourcing different queries for their data).
Trying to add the filter to preview the current record only produces a report with no data and no subreports.
I've looked at the help section for the Open Report Action but am still none the wiser. Is it anything to do with the Filter Name argument?