I use a modified version of the Allen Browne filter script to select records from a query.
The code concludes with the following statement to create the SQL to select the correct records:
I am then trying to pass this through a print button as openargs so the records shown load up in the report:
Then in the report I have:
However the form is just opening with an empty record. Can anyone see anything missing here? I have used a debug.print to show what is being sent in the open args and all seems correct. I have also checked the recordsource and this is showing the correct sql also but no records being shown...
The code concludes with the following statement to create the SQL to select the correct records:
Code:
Me.subfrmlogforfiltering.Form.RecordSource = "Select " & topinsert & " * FROM logforfiltering WHERE " & strWhere
Code:
DoCmd.OpenReport "rptlogforfiltering", acViewPreview, OpenArgs:=Me.subfrmlogforfiltering.Form.RecordSource
Code:
Private Sub Report_Open(Cancel As Integer) Me.RecordSource = Me.OpenArgs End Sub
Code:
Openargs print: Select All * FROM logforfiltering WHERE (([NCStatus] = 'Initial Notification')) Recordsource print: Select All * FROM logforfiltering WHERE (([NCStatus] = 'Initial Notification'))
Comment