Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database Creation

Status
Not open for further replies.

pappion

MIS
Feb 12, 2003
27
0
0
US
Hi, I am creating an event management database - would like to know how to have form display the number of seats remaining for event when attendees registered. My Table shows total number of seats (10) for each event. Thanks!
 
you'll really have to supply a bit more info than that to get an answer!
 
Basically you need to count the number of people who have registered then subtract the number of seats.

But like FACETS said, without more information, it's hard to help any more than that.

Leslie
 
My apologizes I am an access newbie. A field in my course table shows # of seats available. I created a form with a course field and an Available seats field but am not sure about the formula to make this work.

 
Ok so you have a table named Course. you should also have some kind of table called registration that should hold a FK to the Course table.

So let's assume this setup:

tblCourse:
CourseID
CourseName
NumOfSeats

tblRegistration
PersonID (because all your person info should be in the tblPerson)
CourseID (FK to the course table above)

You might be able to do this in one query, but my brain's fried today so I can only think of how to do it with two:

Query1:
SELECT COUNT(*) As taken from tblRegistratiion where courseID = 1

will give you the total of people who have registered for course #1

Then you can take the result from that query and do something like:

SELECT (NumOfSeats - Query1.taken) as remaining from tblCourse

Again with more information from you about your table structure, a more accurate solution could be found, but this should give you the idea.

HTH



Leslie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top