Remove sort and filters programmatically on form

  • Thread starter Thread starter wallymeister
  • Start date Start date
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
 
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
 
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
 
Back
Top