Re: How do I count the number of attendees?
From: Graham Mandeno (Graham.Mandeno_at_nomail.please)
Date: 02/25/04
- Next message: Chris: "DoCmd.OpenReport"
- Previous message: Peter Hoyle: "Re: Week number calculation"
- In reply to: Tracy: "How do I count the number of attendees?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 26 Feb 2004 11:36:00 +1300
Hi Tracy
I'm going to have to make some assumptions here about your table structures.
Let's say you have a table of People (with a primary key PersonID) and a
table of Workshops (with a primary key WorkshopID). Because there is a
many-to-many relationship between these two tables (many people attend a
workshop and a person can attend many workshops) you need to have a third,
"conjunction" table, WorkshopRegistrations, with fields for a PersonID and a
WorkshopID. It might also contain fields *specific to that registration*,
such as confirmation status, payment status, etc.
Now, the number of registrations for a particular workshop is simply a count
of the number of records with the corresponding WorkshopID. You can get
this in a number of ways - here are a few:
1. For a quick one-off count, of a single workshop, use DCount:
DCount( "*", "WorkshopRegistrations", "WorkshopID=23" )
Of course, the "23" here would not be hard-coded - it would come from
somewhere else, like a combo box on a form.
2. Make an aggregate query to return the counts for all workshops:
SELECT WorkshopID, Count(*) as Registrations
from WorkshopRegistrations group by WorkshopID;
3. If you have a form based on Workshops with a linked subform based on
WorkshopRegistrations then you have a good tool for adding registrations to
a particular workshop. You can add to the header or footer of the subform a
textbox with the ControlSource: =Count(*) and that will display the number
of registrations for the current workshop.
Hope this has given you a few ideas.
-- Good Luck! Graham Mandeno [Access MVP] Auckland, New Zealand "Tracy" <anonymous@discussions.microsoft.com> wrote in message news:17b801c3fbde$92aeb320$a401280a@phx.gbl... > I have a database set up for registering attendees to a > conference. The conference is over a few days so > attendees get to choose which workshops they go to. > My problem: How can I keep track of how many people have > registered for a particular workshop as the registrations > come in and they are entered into the database? > > All suggestions welcomed. > > Thanks > Tracy
- Next message: Chris: "DoCmd.OpenReport"
- Previous message: Peter Hoyle: "Re: Week number calculation"
- In reply to: Tracy: "How do I count the number of attendees?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|