A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

sort vs orderby



 
 
Thread Tools Display Modes
  #1  
Old August 25th, 2005, 08:19 AM
Manuel C via AccessMonster.com
external usenet poster
 
Posts: n/a
Default 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  
Old August 25th, 2005, 09:04 AM
Allen Browne
external usenet poster
 
Posts: n/a
Default

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  
Old August 26th, 2005, 05:40 AM
Manuel C via AccessMonster.com
external usenet poster
 
Posts: n/a
Default

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 08:28 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.