counting records

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

Hi,

I am working on a registration database. Currently, I
have a calendar for users to select a time period to
search for available classes. Then an enrollment form is
opened with a subform in it listing the available classes
to choose from. I have a "class limit size" field in the
enrollment table where I am able to limit the class size.
I would like to have the subform only list the classes
that are less than the "class limit size" field (so,
classes aren't over filled). What are some ways to go
about doing this? Do I or can I add criteria to my query
that gets the date range the user selects, which opens up
the form to view available classes? I believe I need to
have my database "count" the records for each "classID",
but I am unsure about how to go about doing this.

Any help would be appreciated. Thanks!!!
 
It shouldn't be too dificult in a query. If I understand you correctly....
Suppose we have the following;

Have a table called "Class" with two fields;
Class ID
Limit

Then we have a table called "Registration" with 2 fields;
Class ID
Student ID

Then we do a query on the 'Class' table adding both fields and in the
criteria of the 'Limit' field we add the following;
DCount("[Class ID]","Registration","[Class ID]='" & [Class ID] & "'")


This query, will now only show the classes have a total count in the
registration table, that is less than the limit for that class...

Hope I got your requirement correct...
 
Thanks Ruskin!!!! I'll give it a try. Have a good
night!!!

-----Original Message-----
It shouldn't be too dificult in a query. If I understand you correctly....
Suppose we have the following;

Have a table called "Class" with two fields;
Class ID
Limit

Then we have a table called "Registration" with 2 fields;
Class ID
Student ID

Then we do a query on the 'Class' table adding both fields and in the
criteria of the 'Limit' field we add the following;
DCount("[Class ID]","Registration","[Class ID]='" &
[Class ID] & "'")


This query, will now only show the classes have a total count in the
registration table, that is less than the limit for that class...

Hope I got your requirement correct...


Dave said:
Hi,

I am working on a registration database. Currently, I
have a calendar for users to select a time period to
search for available classes. Then an enrollment form is
opened with a subform in it listing the available classes
to choose from. I have a "class limit size" field in the
enrollment table where I am able to limit the class size.
I would like to have the subform only list the classes
that are less than the "class limit size" field (so,
classes aren't over filled). What are some ways to go
about doing this? Do I or can I add criteria to my query
that gets the date range the user selects, which opens up
the form to view available classes? I believe I need to
have my database "count" the records for each "classID",
but I am unsure about how to go about doing this.

Any help would be appreciated. Thanks!!!


.
 
Back
Top