Thanks for the reply. It wouldn't be a surprise if the table structure was
wrong, this is my first attempt.
I have a group of students who can take a selection of 18 different modules.
I have a table (& form) with all 18 modules on. I enter the date a student
completes a particular module. Each month i want to query who completed a
module that month. So the criteria changes each month.
I can run the query & revise it each month, but i have to do it all
manually. I am hoping there is a way of speeding things up.
thanks
John
Yep. Your structure is wrong (but it's a very typical mistake for people
learning Access!)
"Fields are expensive, records are cheap". What will you do when the
administration cancels a module, or adds two more? Redesign your table, your
form, all your queries, all your forms, all your reports? Ouch!
Each Student can take many Modules. Each Module can be taken by many Students.
This is a classic many to many relationship, and the correct structure
involves THREE tables:
Students
StudentID <Primary Key>
LastName
FirstName
DateOfBirth
<other appropriate individual biographic data>
Modules
ModuleNo <Primary Key>
ModuleName
<information about the module as a real-life thing>
Enrollment
StudentID <who's involved in this module>
ModuleNo <which module they are involved in>
StartDate
CompletionDate
<other info, e.g. comments, satisfactory/unsatisfactory, etc.>
If a student takes 11 modules, there would be eleven records in the Enrollment
table. If you add a new module, you just need to add a new record in the
Modules table; to find who completed which modules during a month, you have
*ONE* field to search - CompletionDate - in a three table query.
The criterion for "completed during the previous month" would be
= DateSerial(Year(Date()), Month(Date()) - 1, 1) AND < DateSerial(Year(Date()), Month(Date()), 1)
on the DateCompleted field (though you can use this as a criterion on your 18
fields while you're still using this wide-flat spreadsheet design).