K
KittyKool
Hi
I have a filtered form. I have added a command to preview a report and in
the event procedure (from Click) of this command I have added
Private Sub cmd_Preview_Click()
Dim strWhere As String
If Me.Dirty Then Me.Dirty = False 'save any edits
If Me.FilterOn Then strWhere = Me.Filter
DoCmd.OpenReport "AGI Status", acViewPreview, , strWhere
End Sub
The form and report are related to the same query.
The trouble is, when the report opens it contains all records, not the
filtered ones.
Can someone tell me where I have gone wrong and how to fix it please?
Thanks in advance.
Kitty
I have a filtered form. I have added a command to preview a report and in
the event procedure (from Click) of this command I have added
Private Sub cmd_Preview_Click()
Dim strWhere As String
If Me.Dirty Then Me.Dirty = False 'save any edits
If Me.FilterOn Then strWhere = Me.Filter
DoCmd.OpenReport "AGI Status", acViewPreview, , strWhere
End Sub
The form and report are related to the same query.
The trouble is, when the report opens it contains all records, not the
filtered ones.
Can someone tell me where I have gone wrong and how to fix it please?
Thanks in advance.
Kitty