If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
sort vs orderby
Hello everyone
I have used both OrderBy and acCmdSort to sort both ascending and descending on various fields in a form. I personally prefer using OrderBy because i don't have to move the focus to the desired field before sorting. But i was wondering, is there any difference or any benefit of using one over the other? Thanks Manny -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200508/1 |
#2
|
|||
|
|||
If you always want the form sorted in a particular way, the most efficient
solution is to use a query as the form's RecordSource, and specify the sorting there. The OrderBy is simplest way to alter the sort order on the fly; you can do that regardless of what field has focus, specify a combination of fields, easily handle subforms, and even set the OrderBy of a form that does not have focus. The RunCommand is the least useful approach, as it does depend on what has focus. Unfortunately, these is a bug if you set the Filter/OrderBy for both the main form and the subform both. Details in: Incorrect filtering at: http://allenbrowne.com/bug-02.html This problem applies no matter how you set the filtering or sorting. -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Manuel C via AccessMonster.com" wrote in message ... I have used both OrderBy and acCmdSort to sort both ascending and descending on various fields in a form. I personally prefer using OrderBy because i don't have to move the focus to the desired field before sorting. But i was wondering, is there any difference or any benefit of using one over the other? |
#3
|
|||
|
|||
Allen:
Thanks for the info. I was not aware of these bugs, i will try to avoid them as i continue to learn about Access. Manny Allen Browne wrote: If you always want the form sorted in a particular way, the most efficient solution is to use a query as the form's RecordSource, and specify the sorting there. The OrderBy is simplest way to alter the sort order on the fly; you can do that regardless of what field has focus, specify a combination of fields, easily handle subforms, and even set the OrderBy of a form that does not have focus. The RunCommand is the least useful approach, as it does depend on what has focus. Unfortunately, these is a bug if you set the Filter/OrderBy for both the main form and the subform both. Details in: Incorrect filtering at: http://allenbrowne.com/bug-02.html This problem applies no matter how you set the filtering or sorting. I have used both OrderBy and acCmdSort to sort both ascending and descending [quoted text clipped - 3 lines] wondering, is there any difference or any benefit of using one over the other? -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200508/1 |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Refresh of subform after new sort order via orderby | Stephan (Germany) | Using Forms | 3 | June 14th, 2005 01:31 AM |
SORT BY DOMAIN, SORT BY HOST, MULTIPLE WINDOWS | YourDisplayNameHere | General Discussion | 1 | April 28th, 2005 08:36 PM |
Here's a shocker | Mike Labosh | General Discussion | 2 | October 26th, 2004 05:04 PM |
Create New Dictionary Problem Sort by Position | Jean Dophin | General Discussion | 8 | September 21st, 2004 06:33 PM |
Setting up a Command Button to sort | Frank Kabel | Worksheet Functions | 2 | May 22nd, 2004 06:24 PM |