Remove sort and filters programmatically on form

W

wallymeister

I have a form based on a 2 table query. User will use shortcut menu to
filter records down to what they want to work on and sort accordingly. I
have a button to remove all filters but I also want to remove any sorts that
were applied and I can't seem to get that part to work. I use the following
to remove all the filters. I just need help with the code to get the form
back to the original underlying query sort.

On_Click event of button control
Me.Filter = ""
FilterOn = False

Like I said, this brings back all records but the sort stays.
I am using Access 2007

Any help is greatly appreciated.

Wally
 
D

Dirk Goldgar

wallymeister said:
I have a form based on a 2 table query. User will use shortcut menu to
filter records down to what they want to work on and sort accordingly. I
have a button to remove all filters but I also want to remove any sorts
that
were applied and I can't seem to get that part to work. I use the
following
to remove all the filters. I just need help with the code to get the form
back to the original underlying query sort.

On_Click event of button control
Me.Filter = ""
FilterOn = False

Like I said, this brings back all records but the sort stays.
I am using Access 2007


Me.OrderBy = ""
Me.OrderByOn = False
 
W

wallymeister

Thanks Dirk, I swear I tried that before and it didn't work so I thought
there might be something different with 2007, but it worked this time so I
must have done something wrong.

Thanks again
Wally
 

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