Form Not Sorting!!

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

Guest

Hello All,

I have been pulling my hair out on a simple problem. Hoping someone here
has the anwer. I am trying to sort a field on a form by coding it's "on
open" property. The field is a combo box. Here is the code:

Me.OrderBy = "Occurrence ASC"
Me.OrderByOn = True


It appears to group the same words into groups. However, the entire list is
not sorted in ascending order. Any help would be appreciated.

Regards
L
 
Try this:
Me.OrderBy = MyRecordSet![Occurrence ASC]
This assumes Occurrence ASC is a field in your recordset. By the way,
spaces in names is always a bad idea. Consider OccurrenceASC or
Occurrence_ASC
 
Ok I tried that and it gave me an error saying MyRecordSet not
defined...Also, there is no sace...Occurrence is the control source and ASC
is the sort order...

Klatuu said:
Try this:
Me.OrderBy = MyRecordSet![Occurrence ASC]
This assumes Occurrence ASC is a field in your recordset. By the way,
spaces in names is always a bad idea. Consider OccurrenceASC or
Occurrence_ASC

Lowrider72 said:
Hello All,

I have been pulling my hair out on a simple problem. Hoping someone here
has the anwer. I am trying to sort a field on a form by coding it's "on
open" property. The field is a combo box. Here is the code:

Me.OrderBy = "Occurrence ASC"
Me.OrderByOn = True


It appears to group the same words into groups. However, the entire list is
not sorted in ascending order. Any help would be appreciated.

Regards
L
 
MyRecordset should be the name of your record source (table or query).

Me.OrderBy = MyRecordSet![Occurrence]
You don't need the ASC that is the default. If you want descending, then
you would use DESC.

Lowrider72 said:
Ok I tried that and it gave me an error saying MyRecordSet not
defined...Also, there is no sace...Occurrence is the control source and ASC
is the sort order...

Klatuu said:
Try this:
Me.OrderBy = MyRecordSet![Occurrence ASC]
This assumes Occurrence ASC is a field in your recordset. By the way,
spaces in names is always a bad idea. Consider OccurrenceASC or
Occurrence_ASC

Lowrider72 said:
Hello All,

I have been pulling my hair out on a simple problem. Hoping someone here
has the anwer. I am trying to sort a field on a form by coding it's "on
open" property. The field is a combo box. Here is the code:

Me.OrderBy = "Occurrence ASC"
Me.OrderByOn = True


It appears to group the same words into groups. However, the entire list is
not sorted in ascending order. Any help would be appreciated.

Regards
L
 
Back
Top