V
Very Basic User
Hoping you can help...
I'm trying to start to just get a report to generate on the close of a form.
I can get the report containing all records, but have struggled to see only
the record that I'm on when I close. My code is as follows...
Private Sub Form_Close()
DoCmd.OpenReport "Mail Option Report", acPreview
Reports![Mail Option Report].Filter = "Why - Why Number = " & Me![Why - Why
Number]
Reports![Mail Option Report].FilterOn = True
End Sub
I get the following error message when I try to get it to work...
Syntax error (cissing operatro) in query expression ‘(Why – Why Number = 24)’
The # 24 in the Control section is the first record in the form. I get the
same message even if I'm in a different record.
Please help!
I'm trying to start to just get a report to generate on the close of a form.
I can get the report containing all records, but have struggled to see only
the record that I'm on when I close. My code is as follows...
Private Sub Form_Close()
DoCmd.OpenReport "Mail Option Report", acPreview
Reports![Mail Option Report].Filter = "Why - Why Number = " & Me![Why - Why
Number]
Reports![Mail Option Report].FilterOn = True
End Sub
I get the following error message when I try to get it to work...
Syntax error (cissing operatro) in query expression ‘(Why – Why Number = 24)’
The # 24 in the Control section is the first record in the form. I get the
same message even if I'm in a different record.
Please help!