ApplyFilter code runs twice - is this a bug.

L

Louverril

Why does this message box always pop up twice? This occurs in any form no
matter how simple - even with no other code and only one field - when you use
the default right click Access 2007 menu to apply a filter. Please try it
yourself before telling me I'm wrong!!! Must use 2007 no problem in 2003
(different shortcut menu also).


Private Sub Form_ApplyFilter(Cancel As Integer, ApplyType As Integer)
'prevent filtering of cases - causes errors.

MsgBox "You cannot sort or filter cases here."
Cancel = True
Exit Sub

End Sub

I'm using the code to try and prevent tthe user filtering (I have a form
with two nested subforms and if you ban filters on the main form the subforms
are also affected - and no one can tell me a way around this - loads of
questions outstanding loads of suggestions about filteron in various events
- doesn't work - try it!!!).

Thanks Lou
 

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