I have a combo box on a form that contains the months in text format. They
appear in month order on the form but when I query, they are in alphabetical.
How can I get this to be in month order on the query and also look like
months in my cbo and not dates?
George Nicholson - 30 Nov 2005 22:43 GMT
add a field to your query, and then sort on it, not the MonthName:
MonthSortOrder: Month(DateValue(MonthNameField & " 1, 2005"))
if MonthNameField contains "January" then the above will return 1 (the day &
year used are immaterial)
HTH,

Signature
George Nicholson
Remove 'Junk' from return address.
>I have a combo box on a form that contains the months in text format. They
> appear in month order on the form but when I query, they are in
> alphabetical.
> How can I get this to be in month order on the query and also look like
> months in my cbo and not dates?
OfficeDev18 - 30 Nov 2005 22:48 GMT
Make your combo box's rowsource 2 columns, with a hidden column being numeric,
numbered 1 thru 12, sorted on that hidden column. To hide the column, make
the ColumnWidths property 0";1" for example, to hide column 1; to hide column
2, do the opposite. Don't forget to change the ColumnCount to 2. All entries,
of course, are in the combo box's property sheet.
HTH
>I have a combo box on a form that contains the months in text format. They
>appear in month order on the form but when I query, they are in alphabetical.
>How can I get this to be in month order on the query and also look like
>months in my cbo and not dates?

Signature
Sam