Question Arrange Months January - December

AliyuKatsina

Registered User.
Local time
Today, 18:15
Joined
Dec 31, 2009
Messages
73
I have a table with a date field, a form with two combo boxes (cmbYear and cmbMonth). cmbYear extracts distinct Years from the date field, and cmbMonth display month names based on the year selected in cmbYear. My problem is the months are not arranged January to December in the combo box rather alphabetically with April first and September last. Can someone assist?
 
So the months change based on the year? ;)

The solution is to include a second, hidden column with the month's numerical equivalent, and sort on that.
 
I have a table with a date field, a form with two combo boxes (cmbYear and cmbMonth). cmbYear extracts distinct Years from the date field, and cmbMonth display month names based on the year selected in cmbYear. My problem is the months are not arranged January to December in the combo box rather alphabetically with April first and September last. Can someone assist?

Have you considered adding another Field on the Form that contains the full date value and sorting by that? You could set the Field properties to make it invisible so that the users do not see it.

Note: I noticed that (as usual) someone was able to answer before I could.

pbaldy and I seem to agree about using a hidden Field, but I suggested the whole date as opposed to the month, because using the month only would result in records from different years being sorted together, which I do not believe is what you are looking for.
 
Last edited:
I read it that only the 12 months were displayed. If that's not the case, then using the full date would be more appropriate.
 
Thanks. I created a month number field on the querry then hid the field in the combo, and it worked fine.
 
No problem, glad it helped.
 

Users who are viewing this thread

Back
Top Bottom