month

superrob5

Registered User.
Local time
Today, 22:17
Joined
May 8, 2003
Messages
99
I want to run a query so on a form it will come up in order but how would I be able to keep the order of

Jan
Feb
Mar
Apr
May
Jun
Jul

etc.....


Rob
 
...and you've only stored the month abbreviations as text in your tables?

If you have a date that relates to these then you could simply sort it by ascending values and change the field's format to be Format([MyField], "mmm") and nobody would be any the wiser.
 
right now I have a table that will store this info.

employee Table
EmpID
EmpFName
EmpLName
other info

Then I have a Hours Table
EmpID this is linked to the employee tabel and first three fields
Year the primary key
Month
Hours


then I have a month table that is a look up to the hours table
Monthid
Month
1 Jan
2 Feb etc....

I have a form that has EmpID, Firstname, lastname. Then a subform
Year, Month, Hours

month is a combo box

I want to be able to when scrolling through different employees to sort by year then by month.

Rob
 
Last edited:
In the query, include the ID field from the Month table and sort by it.
 
employee Table
EmpID
EmpFName
EmpLName
other info

Hours Table
EmpID this is linked to the employee tabel and first three fields
Year the primary key
Month
Hours

month is a combo box pointed to the table months
which has

monthid
month

On the combo box it doesnt use the primary key it points to the actual month. So when it stores the information it stores the month. Check it out.
 

Attachments

I see what you wanted to do now. I'm not sure how to do it exactly the way you want, but I did apply a solution.

- The form is based on qryHours now instead of the table.
- I set up a relationship between the Month and Hours tables (there were one or two other relationships that need to be set up, but I didn't do it).
- I changed the Month field in the Hours table to MonthID.
- In qryHours I've combined the MonthID and Month fields to give the months in the combo box a sort of ID so the sorting will be correct.

Now this probably wasn't the best way to do it, or the way you wanted it, but I figured I'd give it a try.
 

Attachments

Users who are viewing this thread

Back
Top Bottom