Fred said:
Albert,
Re:
"If you open the form > without a where clause...the orderby setting is
ignored..." and the order will > by the the calling query..."
I'm sure that I know only 1/zillionth of what you do on this, but what I
did/do observe here is that the form's "orderby" is used when you simply
open the form.
correct...I have to explain this a bit better:
In a case of the forms filter option, and the order by option, neither of
them do anything when you open a form. However if you've opened the form and
used the GUI to set the filter or "order by" with the GUI (right click on a
field...sort for example), then YES the form remembers the settings when you
open the form next time.
When you have the form opened and it is remember the order by, now go
Records->remove Filter/Sort
Notice how the above option removes both the order by and the filtering
option
in the above IN ONE SHOT (it is one click...both options are disabled).
If you close the form and then reopen it, you'll notice that the order is
not being set. However if you open up the form in design mode and look at
the property sheet, you WILL see an order by setting is still in existence.
In
other words we have an order by set in the form, but it's not active
anymore. If you open up a form with a where clause, then that order
by setting kicks in!. (this describes pretty much John's scenario).
Furthermore, in my example I was stating that if you actually typed in the
order by command into the Property sheet while in design mode close/save
the form, you will notice a next time you open the form the order by clause
is ignored.
You can also open up the form, and also hit the apply filter sort button.
So what I was saying is that if you have a sort on the form that's not
active (you hit the remove/filter sort button), **or** you typed in the
order by command into the forms property sheet manually, than that order by
setting for the form is ignored until you open the form with a where clause
in code.
So my explanation really wasn't quite full before. You are correct that if
you sort of form using the graphical user interface, then
sort, when you reopen the form next time that's filtering and sorting will
remain in effect. However if you hit the remove filter sort button, you look
at the property sheet the filter and the order by are still set the form,
but they'll continue to be ignored - you get the underlying query order in
this case. at this point you can open and close the form many times and the
order will not be set, however if you hit the apply filter sort button
again, it'll go back to your original sorting and the form remembers this by
use the order by clause in the form's propery sheet...