Access doesn't provide information on what event triggered a message. It may
be the form's Error event.
If it happens only when you use the ApplyFilter action (in a macro) or
method (in VBA code), then you already know what event is firing (e.g. the
click of a command button?) Some things to try:
1. If the form has unsaved edits, Access must commit (or undo) these before
the filter can be applied. Try doing that explicitly before applying the
filter.
If Me.Dirty Then Me.Dirty = False
Note that this will fail if the record cannot be saved (e.g. required field
missing.)
2. Try setting the Filter property of the form instead of ApplyFilter, e.g.:
Me.Filter = "(SomeField = 99)"
Me.FilterOn = True
(There is also a bug in Access 2002 Service Pack 3 that causes this message
to be triggered wrongly after you have deleted a record.)
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Dorian" <(E-Mail Removed)> wrote in message
news:0DC50F84-E658-41EC-88B8-(E-Mail Removed)...
>I just started getting a 'no current record' error on an ApplyFilter
> statement (it worked fine before). However, the actual error is
> elsewhere -
> in some event being fired. I know the Current event is firing but I think
> the
> error is somewhere else. How can I find out where? I tried setting a
> breakpoint and stepping through but it always stops on the ApplyFilter
> statement and says "you can't use this statement in this window".
>
> Thanks for any assistance. This has had me stuck for quite a while.