Form Not Sorting!!

L

Lowrider72

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
 
D

Dennis

The On Open property and OrderBy etc. are form properties not the combobox
field properties. Go into the properties of the combo box and look at its row
source property. You can put an 'ORDER BY' statement at the end. Below is an
example of a row source property. Change yours accordingly to sort by the
field you require.
SELECT People.TestID, People.Name, People.WhatTime FROM People ORDER BY
[TestID];
 
L

Lowrider72

Yes, I am trying to sort the column on the form and not the combobox....The
row does not sort when I code the "on open" property of the form...

Dennis said:
The On Open property and OrderBy etc. are form properties not the combobox
field properties. Go into the properties of the combo box and look at its row
source property. You can put an 'ORDER BY' statement at the end. Below is an
example of a row source property. Change yours accordingly to sort by the
field you require.
SELECT People.TestID, People.Name, People.WhatTime FROM People ORDER BY
[TestID];

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top