orderby will not work - what the @$*&

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have two forms in Access
On the first form I am trying to sort by the field: File_
In the form properties I made these adjustments:
base: form properties: order by = [table name].FILE_
In the data tab:
allow deletions=no
record locks=edited record

I save it, close it, reopen and it is still not sorted by the File_ field.

On the second form I want to sort by two fields:
1st by File_ & second by Cat_
I made these adjustments:
base: form properties: order by = [table name].FILE_, [table name].Cat_
on the data tab:
allow deletions=no
record locks=edited record

same problem.

I have research several sites including microsoft's and I am unable to find
the proper settings I need to make orderby function.

Can anyone explain to me what I need exactly so I can get this monkey of my
back?

Sincerely,

Stressed beyond belief
 
I assume that the "=" signs you show are just to indicate the value for the
property, and are not actually in the string that you put in the properties.

Simply putting a string in the Order By property will not turn on the sort
in the form. You must run code when the form opens that sets the form's
OrderByOn property to True, and then the string in the Order By property
will be the sort method used.

Unless you plan to change the sort order for the form while it's open, it's
much easier to put the sorting method in the query that serves as the form's
recordsource. If you're basing the form directly on a table, create a query
that is based on the table instead and put a "Sort" value under the desired
field in that query, then set the form's Record Source to that query.
 
Sounds like it might work.
You are correct, I am not putting the = in the string.

How do I put the sorting method in the query? Can you give me a step-by-step?

Thanks for your reply

Ken Snell said:
I assume that the "=" signs you show are just to indicate the value for the
property, and are not actually in the string that you put in the properties.

Simply putting a string in the Order By property will not turn on the sort
in the form. You must run code when the form opens that sets the form's
OrderByOn property to True, and then the string in the Order By property
will be the sort method used.

Unless you plan to change the sort order for the form while it's open, it's
much easier to put the sorting method in the query that serves as the form's
recordsource. If you're basing the form directly on a table, create a query
that is based on the table instead and put a "Sort" value under the desired
field in that query, then set the form's Record Source to that query.

--

Ken Snell
<MS ACCESS MVP>




Mike said:
I have two forms in Access
On the first form I am trying to sort by the field: File_
In the form properties I made these adjustments:
base: form properties: order by = [table name].FILE_
In the data tab:
allow deletions=no
record locks=edited record

I save it, close it, reopen and it is still not sorted by the File_ field.

On the second form I want to sort by two fields:
1st by File_ & second by Cat_
I made these adjustments:
base: form properties: order by = [table name].FILE_, [table name].Cat_
on the data tab:
allow deletions=no
record locks=edited record

same problem.

I have research several sites including microsoft's and I am unable to
find
the proper settings I need to make orderby function.

Can anyone explain to me what I need exactly so I can get this monkey of
my
back?

Sincerely,

Stressed beyond belief
 
I haven't seen "Orderbyon" or anything like that.

Rhare is it?

Mike

Douglas J. Steele said:
Are you remembering to set OrderByOn to True as well?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Mike said:
I have two forms in Access
On the first form I am trying to sort by the field: File_
In the form properties I made these adjustments:
base: form properties: order by = [table name].FILE_
In the data tab:
allow deletions=no
record locks=edited record

I save it, close it, reopen and it is still not sorted by the File_ field.

On the second form I want to sort by two fields:
1st by File_ & second by Cat_
I made these adjustments:
base: form properties: order by = [table name].FILE_, [table name].Cat_
on the data tab:
allow deletions=no
record locks=edited record

same problem.

I have research several sites including microsoft's and I am unable to
find
the proper settings I need to make orderby function.

Can anyone explain to me what I need exactly so I can get this monkey of
my
back?

Sincerely,

Stressed beyond belief
 
Mike said:
I haven't seen "Orderbyon" or anything like that.

Rhare is it?

It can only be set with code. The OrderBy property that you see in the property
sheet is quite useless by itself.

Have you tried just binding your form to a query with an ORDER BY clause?
 
Open the query in design view. You'll see a row labeled "Sort:". Under the
field that should be used to sort the data, in that row, select ASCENDING or
DESCENDING.

--

Ken Snell
<MS ACCESS MVP>

Mike said:
Sounds like it might work.
You are correct, I am not putting the = in the string.

How do I put the sorting method in the query? Can you give me a
step-by-step?

Thanks for your reply

Ken Snell said:
I assume that the "=" signs you show are just to indicate the value for
the
property, and are not actually in the string that you put in the
properties.

Simply putting a string in the Order By property will not turn on the
sort
in the form. You must run code when the form opens that sets the form's
OrderByOn property to True, and then the string in the Order By property
will be the sort method used.

Unless you plan to change the sort order for the form while it's open,
it's
much easier to put the sorting method in the query that serves as the
form's
recordsource. If you're basing the form directly on a table, create a
query
that is based on the table instead and put a "Sort" value under the
desired
field in that query, then set the form's Record Source to that query.

--

Ken Snell
<MS ACCESS MVP>




Mike said:
I have two forms in Access
On the first form I am trying to sort by the field: File_
In the form properties I made these adjustments:
base: form properties: order by = [table name].FILE_
In the data tab:
allow deletions=no
record locks=edited record

I save it, close it, reopen and it is still not sorted by the File_
field.

On the second form I want to sort by two fields:
1st by File_ & second by Cat_
I made these adjustments:
base: form properties: order by = [table name].FILE_, [table name].Cat_
on the data tab:
allow deletions=no
record locks=edited record

same problem.

I have research several sites including microsoft's and I am unable to
find
the proper settings I need to make orderby function.

Can anyone explain to me what I need exactly so I can get this monkey
of
my
back?

Sincerely,

Stressed beyond belief
 
I just now had a chance to try it. this is the one that worked.

Excellent way to work around this problem.

Thanks very much.

Mike

Ken Snell said:
I assume that the "=" signs you show are just to indicate the value for the
property, and are not actually in the string that you put in the properties.

Simply putting a string in the Order By property will not turn on the sort
in the form. You must run code when the form opens that sets the form's
OrderByOn property to True, and then the string in the Order By property
will be the sort method used.

Unless you plan to change the sort order for the form while it's open, it's
much easier to put the sorting method in the query that serves as the form's
recordsource. If you're basing the form directly on a table, create a query
that is based on the table instead and put a "Sort" value under the desired
field in that query, then set the form's Record Source to that query.

--

Ken Snell
<MS ACCESS MVP>




Mike said:
I have two forms in Access
On the first form I am trying to sort by the field: File_
In the form properties I made these adjustments:
base: form properties: order by = [table name].FILE_
In the data tab:
allow deletions=no
record locks=edited record

I save it, close it, reopen and it is still not sorted by the File_ field.

On the second form I want to sort by two fields:
1st by File_ & second by Cat_
I made these adjustments:
base: form properties: order by = [table name].FILE_, [table name].Cat_
on the data tab:
allow deletions=no
record locks=edited record

same problem.

I have research several sites including microsoft's and I am unable to
find
the proper settings I need to make orderby function.

Can anyone explain to me what I need exactly so I can get this monkey of
my
back?

Sincerely,

Stressed beyond belief
 
Back
Top