Date order for months on query

T

Todd

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?
 
G

George Nicholson

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,
 
O

OfficeDev18 via AccessMonster.com

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
 
Top