2501 error on DoCmd.ApplyFilter

L

LJB

I have one PC in the office that is returning error 2501 ...action canceled
on the ApplyFilter line below. All other PC's seem to be fine with it. The
database is Access 2000.

Private Function GoToSectionNextAvail(lStart As Long, lEnd As Long)
DoCmd.OpenTable "Parts", acViewNormal, acEdit
DoCmd.ApplyFilter , "[Part] Between " & lStart & " and " & lEnd


Any ideas?

thanks
LJB
 
A

Allen Browne

There are lots of reasons why a filter might be cancelled, e.g.: the table
was already open, with a partial entry that cannot be saved (e.g. required
field missing), or perhaps Part is a Text field (not a Number field so the
filter expression needs more quotes.

You will have much more power (and debugging information) if you use a form
rather than opening the table itself. Use Datasheet View if you want it to
look like a table.
 
L

LJB

Allen Browne said:
There are lots of reasons why a filter might be cancelled, e.g.: the table
was already open, with a partial entry that cannot be saved (e.g. required
field missing), or perhaps Part is a Text field (not a Number field so the
filter expression needs more quotes.

You will have much more power (and debugging information) if you use a
form rather than opening the table itself. Use Datasheet View if you want
it to look like a table.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

LJB said:
I have one PC in the office that is returning error 2501 ...action
canceled on the ApplyFilter line below. All other PC's seem to be fine
with it. The database is Access 2000.

Private Function GoToSectionNextAvail(lStart As Long, lEnd As Long)
DoCmd.OpenTable "Parts", acViewNormal, acEdit
DoCmd.ApplyFilter , "[Part] Between " & lStart & " and " & lEnd

Unfortunately I don't have time to convert this to a form and write the
code. The curious thing is that it always happens on this PC and never on
the others. I'm left wondering if there is an Access 2000 patch missing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top