sort on form close

L

LGarcia

Hi all,
I have a subform that comes off of a query. I have it sorted by the field
"Subject" as the default.
My users are able to go into any control on the form and right click to sort
by that field.
When the form is closed and then re-opend, the sort has changed from the
default. How can I re-sort the form based on the default either at the On
Close or On Open event? Using AccessXP.
TIA,
LGarcia
 
J

John Vinson

When the form is closed and then re-opend, the sort has changed from the
default. How can I re-sort the form based on the default either at the On
Close or On Open event? Using AccessXP.

Base the Form on a Query sorted by the default; in the Form's Close
event put

Me.OrderBy = ""
Me.OrderByOn = False

to undo any user sorts.

Of course, if your form complains that it's "out of sorts" afterwards,
don't blame me!
 

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