[AccessD] Order By

Dan Waters dwaters at usinternet.com
Thu Feb 16 14:52:16 CST 2006


Yes - for Forms, this can only be set in code.  For Reports, you can set it
in the Report's property sheet.

Take a look at Help for OrderbyOn.  I would recommend setting this property
prior to each time you want to set the Orderby value.

I just did a test and it turns out that if you make a new form without a
recordsource, the OrderbyOn property is False by default.  So, for a form
like this you'll need to set it to True in code.

Dan 
 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of John Clark
Sent: Thursday, February 16, 2006 1:58 PM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Order By

I'm going to sound totally "duh" here, but I've never heard of
OrderByOn. Is it only a code thing, or is it in the properties box?

Well, I knew it would be simple. Thanks Lambert and Dan!

>>> dwaters at usinternet.com 2/16/2006 2:29 PM >>>
John,

What I do if I want a form to be ordered is to use these two lines in
the
Open event:

	Me.OrderbyOn = True
	Me.Orderby = "FieldName"

This lets you stay out of the recordsource field just to get things
ordered.

Dan 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com 
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of John Clark
Sent: Thursday, February 16, 2006 12:47 PM
To: accessd at databaseadvisors.com 
Subject: [AccessD] Order By

I ran into a slight problem today. I've gotten passed it, but I am
still
curious.

I designed a form and tried putting into order by a control number. To
do this I figured I had to add it to the "Order By" property of the
form. However, this did not give me any results. What I ended up
doing,
in the essence of time, is put a SELECT statement in the Control
Source
of the form, ending in an Order By statement.

Why wouldn't this work the first way?

John Clark
-- 
AccessD mailing list
AccessD at databaseadvisors.com 
http://databaseadvisors.com/mailman/listinfo/accessd 
Website: http://www.databaseadvisors.com 

-- 
AccessD mailing list
AccessD at databaseadvisors.com 
http://databaseadvisors.com/mailman/listinfo/accessd 
Website: http://www.databaseadvisors.com
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list