B
Brad Pears
I have a situation where I have a form based on a query. The form displays
rows from this query. I would like the user to be able to simply click an
check box to change the sort order of the records being displayed there (I
am not using a listview control.) To do this now, depending on the option
selected, I change the recordsource to different query - where the query
selected has the appropriate sort order. This meant I had to create several
similar queries with only the sorting being changed...
I know this MUST be the long way. I tried simply setting the "Orderby"
property for the form but that did not do anything at all. Once you set that
orderby property, what command do you need to run to actually get it to
reorder based on that field? I tried refresh and that did nothing at all.
And, can you specify "ascending or descending" after the "orderby" field you
use?? (ie. me.orderby = "Date descending")
Here is sample code... (that did nothing)
if chkDateOrder then
me.orderby = "Date"
else if chkNameOrder then
me.orderby = "Name"
endif
'Now refresh
me.refresh
Any help would be most appreciated!
Thanks,
Brad
rows from this query. I would like the user to be able to simply click an
check box to change the sort order of the records being displayed there (I
am not using a listview control.) To do this now, depending on the option
selected, I change the recordsource to different query - where the query
selected has the appropriate sort order. This meant I had to create several
similar queries with only the sorting being changed...
I know this MUST be the long way. I tried simply setting the "Orderby"
property for the form but that did not do anything at all. Once you set that
orderby property, what command do you need to run to actually get it to
reorder based on that field? I tried refresh and that did nothing at all.
And, can you specify "ascending or descending" after the "orderby" field you
use?? (ie. me.orderby = "Date descending")
Here is sample code... (that did nothing)
if chkDateOrder then
me.orderby = "Date"
else if chkNameOrder then
me.orderby = "Name"
endif
'Now refresh
me.refresh
Any help would be most appreciated!
Thanks,
Brad