Date order for months on query

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

Guest

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?
 
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,
 
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
 
Back
Top