R
Ralph Wischnewski
This question comes up occasionally on this community, but I still can't
figure it out.
I have a global filter set up: Public gstrDirView
I have a unbound form that allows users to select criteria with the results
showing on a "View" form. I use the "gstrDirView" to filter the records and
this works just fine. After viewing the results on this view Form the users
want to print a report showing these filtered records. There is a command
button on the View Form that opens the report, and on the report's "OnOpen"
event I have the following code:
Private Sub Report_Open(Cancel As Integer)
On Error GoTo Err_Report_Open_Click
If gsrtdirView <> vbNullString Then
Me.Filter = gstrDirView
Me.FilterOn = True
gstrDirView = vbNullString
End If
Exit_Report_Open_Click:
Exit Sub
Err_Report_Open_Click:
MsgBox Err.Description
Resume Exit_Report_Open_Click
End Sub
The report however continues to show all records of the undelying querry.
What am I doing wrong?
Thank you
figure it out.
I have a global filter set up: Public gstrDirView
I have a unbound form that allows users to select criteria with the results
showing on a "View" form. I use the "gstrDirView" to filter the records and
this works just fine. After viewing the results on this view Form the users
want to print a report showing these filtered records. There is a command
button on the View Form that opens the report, and on the report's "OnOpen"
event I have the following code:
Private Sub Report_Open(Cancel As Integer)
On Error GoTo Err_Report_Open_Click
If gsrtdirView <> vbNullString Then
Me.Filter = gstrDirView
Me.FilterOn = True
gstrDirView = vbNullString
End If
Exit_Report_Open_Click:
Exit Sub
Err_Report_Open_Click:
MsgBox Err.Description
Resume Exit_Report_Open_Click
End Sub
The report however continues to show all records of the undelying querry.
What am I doing wrong?
Thank you