Can anyone tell me why this isn't working?
From frmMenu the user clicks button Generate Report. In code I want to read the value of field vendor_id from table tblVendorID and put it into variable strID. I want to use this variable to open report rptApprovals. This report's record source is tblApprovals. When I run through my code with debug I can see that the value of strID is getting set correctly. Does something in my code need to be changed or is it something in my report?
Dim rstVendorID As DAO.Recordset
Dim strID As String
Set rstVendorID = CurrentDb.OpenRecordset("tblVendorID")
rstVendorID.MoveFirst
strID = rstVendorID.Fields("vendor_id").Value
DoCmd.OpenReport "rptApprovals", acPreview, , strID
Is this even possible? I've tried everything I can think of. Any help you can give is appreciated.
Lisa R.
From frmMenu the user clicks button Generate Report. In code I want to read the value of field vendor_id from table tblVendorID and put it into variable strID. I want to use this variable to open report rptApprovals. This report's record source is tblApprovals. When I run through my code with debug I can see that the value of strID is getting set correctly. Does something in my code need to be changed or is it something in my report?
Dim rstVendorID As DAO.Recordset
Dim strID As String
Set rstVendorID = CurrentDb.OpenRecordset("tblVendorID")
rstVendorID.MoveFirst
strID = rstVendorID.Fields("vendor_id").Value
DoCmd.OpenReport "rptApprovals", acPreview, , strID
Is this even possible? I've tried everything I can think of. Any help you can give is appreciated.
Lisa R.