L
Leslie Isaacs
Hello All
I have a form called [frm message log], andf in the form header is an
unbound textbox called [msgsearch] and a toggle called [tglEnded]. One of
the fields in the detail section is [msgended] (a true/false field). Also in
the form header is a button with the following onClick event:
If [Forms]![frm message log]![tglEnded] = False Then
Me.Filter = "[msgended] = False AND [msgtext] like
""*""&[Forms]![frm message log]![msgsearch] &""*"""
Else
Me.Filter = "[msgtext] like ""*""&[Forms]![frm message
log]![msgsearch] &""*"""
End If
Me.FilterOn = True
The filter in 'true' part of the condition works fine, but when the
condition fails the second filter generates an error - Runtime error 3021No
Current Record.
I can't understand this, as the second filter is the same as the first
filter except that it excludes the first part - i.e. [msgended] = False. I
have even tried making the second filter
Me.Filter = "([msgended] = False OR [msgended] = True) AND [msgtext]
like ""*""&[Forms]![frm message log]![msgsearch] &""*"""
but this gives the same error.
Is this a bug - or am I being thick?
Hope someone can help.
Thanks in advance.
Les
I have a form called [frm message log], andf in the form header is an
unbound textbox called [msgsearch] and a toggle called [tglEnded]. One of
the fields in the detail section is [msgended] (a true/false field). Also in
the form header is a button with the following onClick event:
If [Forms]![frm message log]![tglEnded] = False Then
Me.Filter = "[msgended] = False AND [msgtext] like
""*""&[Forms]![frm message log]![msgsearch] &""*"""
Else
Me.Filter = "[msgtext] like ""*""&[Forms]![frm message
log]![msgsearch] &""*"""
End If
Me.FilterOn = True
The filter in 'true' part of the condition works fine, but when the
condition fails the second filter generates an error - Runtime error 3021No
Current Record.
I can't understand this, as the second filter is the same as the first
filter except that it excludes the first part - i.e. [msgended] = False. I
have even tried making the second filter
Me.Filter = "([msgended] = False OR [msgended] = True) AND [msgtext]
like ""*""&[Forms]![frm message log]![msgsearch] &""*"""
but this gives the same error.
Is this a bug - or am I being thick?
Hope someone can help.
Thanks in advance.
Les