Decrease numeric value of Table field when form submitted

betheball

Registered User.
Local time
Today, 04:57
Joined
Feb 5, 2003
Messages
107
I am trying to design an on-line form for an upcoming seminar. The seminar will be held on three different days with a maximum number of attendees of 25 per session. I want to create a form for those wanting to attend. What I want to do is when a user submits a registration, a query will run that subtracts from the number of available spots. For example, I will have a table that will have only two fields: SeminarDate and AvailableSpots. The SeminarDate field will be populated with the three dates and the AvailableSpots will have an initial value of 25 for each date. What do I need to do to make it so the AvailableSpots field decreases by one each time someone signs up?

Also, how do I do just the opposite? I want to have a second form for anyone who changes their mind and decides not to attend. How would I increase by one the value in the AvailableSpots field when this form is submitted?

-Duane-
 
Last edited:
Hi Duane,

You need another table.

tblSeminars:
SeminarName
SeminarDate
SeminarSAttendees

tblSeminarAttendees
SeminarName
SeminarAttendee

This way you won't have to try and maintain that number.

The projected and current actual attendees will always
be readily available through queries.

Select count(*) from tblSeminarAttendees where SeminarName = 'aaa';

You should not write code to try and maintain the number.

In the long run, it will make your life much easier and more
flexible.

hth,
Wayne
 
Hi Duane,

You need another table.

tblSeminars:
SeminarName
SeminarDate
SeminarSAttendees

tblSeminarAttendees
SeminarName
SeminarAttendee

This way you won't have to try and maintain that number.

The projected and current actual attendees will always
be readily available through queries.

Select count(*) from tblSeminarAttendees where SeminarName = 'aaa';

You should not write code to try and maintain the number.

In the long run, it will make your life much easier and more
flexible.

hth,
Wayne

Mr.Wayne,
Sir
can you help me with something similar to this.....
 

Users who are viewing this thread

Back
Top Bottom