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  

sorting by control value



 
 
Thread Tools Display Modes
  #1  
Old June 2nd, 2009, 04:09 AM posted to microsoft.public.access.forms
Russ[_2_]
external usenet poster
 
Posts: 52
Default sorting by control value

Is there a way to sort a form's reports by the value found in a
specified field or control? Normally the form will sort according to
record number, and that is just not going to work as the records were
entered not in the order I would like to have them viewed. The Order
By in the form's property window appears to do nothing when I enter
the control's name in it.
  #2  
Old June 2nd, 2009, 04:26 AM posted to microsoft.public.access.forms
fredg
external usenet poster
 
Posts: 4,386
Default sorting by control value

On Mon, 01 Jun 2009 22:09:33 -0500, Russ wrote:

Is there a way to sort a form's reports by the value found in a
specified field or control? Normally the form will sort according to
record number, and that is just not going to work as the records were
entered not in the order I would like to have them viewed. The Order
By in the form's property window appears to do nothing when I enter
the control's name in it.


When you manually add a control name to the OrderBy property NOTHING
happens unless you also tell Access to apply the sort.
You apply the sort when you right click on the form (in Form View) and
select "Apply Filter/Sort".
Conversely, to go back to the previous sort, you would right-click on
the form and select "Remove Filter/Sort"

Anything wrong with you simply selecting the control and clicking on
the Sort A-Z or Z-A toolbutton?

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #3  
Old June 2nd, 2009, 04:37 AM posted to microsoft.public.access.forms
Gina Whipp
external usenet poster
 
Posts: 3,500
Default sorting by control value

Russ,

You could try placing the below in the On_Open event of the form...

Me.OrderBy = "YourFieldNameHere"
Me.OrderByOn = True

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"Russ" wrote in message
...
Is there a way to sort a form's reports by the value found in a
specified field or control? Normally the form will sort according to
record number, and that is just not going to work as the records were
entered not in the order I would like to have them viewed. The Order
By in the form's property window appears to do nothing when I enter
the control's name in it.



  #4  
Old June 2nd, 2009, 03:00 PM posted to microsoft.public.access.forms
Russ[_2_]
external usenet poster
 
Posts: 52
Default sorting by control value

On Mon, 1 Jun 2009 20:26:20 -0700, fredg
wrote:

On Mon, 01 Jun 2009 22:09:33 -0500, Russ wrote:

Is there a way to sort a form's reports by the value found in a
specified field or control? Normally the form will sort according to
record number, and that is just not going to work as the records were
entered not in the order I would like to have them viewed. The Order
By in the form's property window appears to do nothing when I enter
the control's name in it.


When you manually add a control name to the OrderBy property NOTHING
happens unless you also tell Access to apply the sort.
You apply the sort when you right click on the form (in Form View) and
select "Apply Filter/Sort".
Conversely, to go back to the previous sort, you would right-click on
the form and select "Remove Filter/Sort"

Anything wrong with you simply selecting the control and clicking on
the Sort A-Z or Z-A toolbutton?



Thanks. I was not aware of having the user tell Access to apply the
sort. I wondered why that never worked for me.

However, I really want the form to display the records sorted by that
particular control when it's initially opened without the user
applying the sort. Any way to do that?
  #5  
Old June 2nd, 2009, 03:03 PM posted to microsoft.public.access.forms
Russ[_2_]
external usenet poster
 
Posts: 52
Default sorting by control value

On Mon, 1 Jun 2009 23:37:07 -0400, "Gina Whipp"
wrote:

Russ,

You could try placing the below in the On_Open event of the form...

Me.OrderBy = "YourFieldNameHere"
Me.OrderByOn = True



Thanks Gina I think that may work out fine. I tried the OrderBy code
yesterday, but was unable to figure out the syntax with my limited
knowledge of VBA.
  #6  
Old June 2nd, 2009, 03:11 PM posted to microsoft.public.access.forms
Gina Whipp
external usenet poster
 
Posts: 3,500
Default sorting by control value

Russ,

Your knowledge is not limited... you knew where to come to get the answer, I
call that VAST knowledge!

Your Welcome,
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"Russ" wrote in message
...
On Mon, 1 Jun 2009 23:37:07 -0400, "Gina Whipp"
wrote:

Russ,

You could try placing the below in the On_Open event of the form...

Me.OrderBy = "YourFieldNameHere"
Me.OrderByOn = True



Thanks Gina I think that may work out fine. I tried the OrderBy code
yesterday, but was unable to figure out the syntax with my limited
knowledge of VBA.



  #7  
Old June 2nd, 2009, 09:18 PM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default sorting by control value

On Mon, 01 Jun 2009 22:09:33 -0500, Russ wrote:

Is there a way to sort a form's reports by the value found in a
specified field or control? Normally the form will sort according to
record number, and that is just not going to work as the records were
entered not in the order I would like to have them viewed. The Order
By in the form's property window appears to do nothing when I enter
the control's name in it.


Just note that you can base the Form on a Query sorted appropriately, and it
will use that order with no code at all. The form's OrderBy property can be
used to override this sort if you choose.
--

John W. Vinson [MVP]
 




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


All times are GMT +1. The time now is 09:04 AM.


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