Filter problem

  • Thread starter Thread starter Leslie Isaacs
  • Start date Start date
L

Leslie Isaacs

Hello All
This is driving me nuts - hope someone can help.
I have a report based on a query that contains the yes/no field [eventngms].
The report's OnOpen event is the following:

Private Sub Report_Open(Cancel As Integer)
On Error Resume Next
Me.Filter = "[eventngms] = true"
Me.FilterOn = True
End Sub

The query does contain records that meet this condition, but the report
won't open - I get the message about the expression not resulting in the
name of a macro etc or that there has been an error evaluating the event,
etc.
I have used filter code similar to the above hundreds of times without a
problem: what's going on here?
Very grateful for any assistance!

Les.
 
Hello All
This is driving me nuts - hope someone can help.
I have a report based on a query that contains the yes/no field [eventngms].
The report's OnOpen event is the following:

Private Sub Report_Open(Cancel As Integer)
On Error Resume Next
Me.Filter = "[eventngms] = true"
Me.FilterOn = True
End Sub

The query does contain records that meet this condition, but the report
won't open - I get the message about the expression not resulting in the
name of a macro etc or that there has been an error evaluating the event,
etc.
I have used filter code similar to the above hundreds of times without a
problem: what's going on here?
Very grateful for any assistance!

Les.

Your code, exactly as written (with a different check box name), works
perfectly for me.
I suspect, however, that on the property sheets Open event line you
wrote = [Event Procedure]

I get a similar error if I place an = sign in front of [Event
Procedure], i.e. = [Event Procedure], on the Open event line.
It should be [Event Procedure], without the = sign.
 
Hello Fred
Thanks for your reply.
Unfortunately that's not it - I have [Event Procedure] on the OnOpen line of
the report's event properties (without the =), but still no joy.
I have in fact rem'ed out the filter itself, so now the code is:

Private Sub Report_Open(Cancel As Integer)
On Error Resume Next
'Me.Filter = "[eventngms] = true"
'Me.FilterOn = True
End Sub

.... but still I get the same error.

I would be very grateful for any further suggestions, etc.

Many thanks
Les.


fredg said:
Hello All
This is driving me nuts - hope someone can help.
I have a report based on a query that contains the yes/no field [eventngms].
The report's OnOpen event is the following:

Private Sub Report_Open(Cancel As Integer)
On Error Resume Next
Me.Filter = "[eventngms] = true"
Me.FilterOn = True
End Sub

The query does contain records that meet this condition, but the report
won't open - I get the message about the expression not resulting in the
name of a macro etc or that there has been an error evaluating the event,
etc.
I have used filter code similar to the above hundreds of times without a
problem: what's going on here?
Very grateful for any assistance!

Les.

Your code, exactly as written (with a different check box name), works
perfectly for me.
I suspect, however, that on the property sheets Open event line you
wrote = [Event Procedure]

I get a similar error if I place an = sign in front of [Event
Procedure], i.e. = [Event Procedure], on the Open event line.
It should be [Event Procedure], without the = sign.
 
Back
Top