Clear Filter on closing a form

F

Frank Situmorang

Hello,

Waht is the VBA for every closing the form, the filter will atuotomatically
removed, because often that it will remember the filter and the clerck said "
I can not see my data that I just entered" they he/she did not remove the
filter.

On the form property I would write the VBA on close event.

Thanks in advance,

Frank
 
D

Douglas J. Steele

Try:

Private Sub Form_Close()

Me.FilterOn = False
Me.Filter = vbNullString

End Sub
 
F

Frank Situmorang

Doug,
I have put your code, but it does not work. I tried to open my form than I
put cursor in the amount field, and typed >1000000, then I filter by form, it
worked, it showed only amount bigger than 1 million, than I closed the form,
and I open it again, and I see the one that I typed in the amount field
1000000 still showed.

I appreciate your idea again.

Thanks

Frank
 
D

Douglas J. Steele

You sure the code is actually firing? Put a breakpoint in there to make sure
it is.
 

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