D
DBG
I have the following code on my report:
Private Sub Report_Open(Cancel As Integer)
Dim PONum As String
PONum = "1276" ' Sample number for testing
Dim db As Database
Dim rec As DAO.Recordset
Dim qdfParmQry As DAO.QueryDef
Set db = CurrentDb()
Set qdfParmQry = db.QueryDefs("qryPOReportData")
qdfParmQry.Parameters("PONumber") = PONum
Set rec = qdfParmQry.OpenRecordset()
End Sub
The query requires a parameter, and properly scopes the results to that
parameter.
However, when I open my report, this code executes and does nothing, then my
report pops up the standard box asking for my query parameter, then displays
the report with the scoped query info.
What am I doing wrong here?
Thanks,
-David
Private Sub Report_Open(Cancel As Integer)
Dim PONum As String
PONum = "1276" ' Sample number for testing
Dim db As Database
Dim rec As DAO.Recordset
Dim qdfParmQry As DAO.QueryDef
Set db = CurrentDb()
Set qdfParmQry = db.QueryDefs("qryPOReportData")
qdfParmQry.Parameters("PONumber") = PONum
Set rec = qdfParmQry.OpenRecordset()
End Sub
The query requires a parameter, and properly scopes the results to that
parameter.
However, when I open my report, this code executes and does nothing, then my
report pops up the standard box asking for my query parameter, then displays
the report with the scoped query info.
What am I doing wrong here?
Thanks,
-David