OrderBy property management

N

ntc

this question isn't so much to solve a problem but to get a better
understanding of the Orderby property...

sometimes I will look at a form and find a value in that field that wasn't
put in by the designer...and not intentionally entered by the user; and so
was wondering in general what dictates this field's value ??

if it is blank; and a user sorts A-Z on a form column...does this enter into
the OrderBy field? ...and if so does it stay there just for the session and
will be blank when reopened... ??

I see it over rides the query sort ...but my puzzlement is when there is a
value in there not by the designer and not knowingly by the user....

just a general question would be interested to understand better.....
 
A

Allen Browne

Yes: if the user right-clicks a control and chooses to sort by it (or uses
the toolbar buttons), the form's OrderBy and OrderByOn properties are set.
You can verify this while the form is still open by entering something like
this in the Immediate Window (Ctrl+G):
? Forms!Form1.OrderBy

But does the property get remembered when the form is closed? The answer is
sometimes. In some versions of Access, or if you have performed some other
changes, you may get a message when you close the form asking, 'Save
changes?' If you answer Yes to this question you are saving the design
changes.

Similarly, if you switch the form to design view after applying a filter (so
the OrderBy is set) and then save your changes, you may have saved this
property.

Access 2007 has new properties for OrderByOnLoad and FilterOnLoad. You need
to explicitly set these to No if you don't want these things automatically
applied each time the form is loaded.
 
N

ntc

thanks Allen, I looked up in my 07 InsideOut and don't see anything in
the index for the onload... will save that...(you should write a book)...

users never go into design view so form properties are set by the
designer...except this OrderBy field which can be altered by the user
(knowingly or unknowingly) during normal use....which maybe implies the
consideration of always putting an explicit clearing of that field on
load..not sure...

is this the only form property field that the user can alter during normal
use??
 

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