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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

counting bookings 1

Status
Not open for further replies.

annabellagb

Technical User
Oct 6, 2003
4
0
0
GB
Hi,
I would like to be able to display automatically the number of bookings received for an event wih limited places so that people can see if there are places left and can put their names on the waiting lists. Booking details are stored in an Access database. I use ASP
Thank you very much
 
Just create a recordset that selects all bookings for a certain event, then display the number of records.

Or get clever and put the total number of places that will be available into the master booking table and do a quick bit of math to display the number of places left.

Cheech

[Peace][Pipe]
 
Thanks Cheech, I can see what u mean but being still a bit of a newbie, can you explain to me what you mean by the "quick bit of maths to display the number of places left"?
 
Sure,

Assign a field in your event table that holds the total number of available places for each event. Now go to bindings for the recordset that has selected all bookings for the event you are displaying.
Temporarily bind "Total Number of Records" to where you want to display the number left on your page, also bind the total bookings field. This will put the code that has counted the number of records into your page & the maximum number of Bookings. Go to code view and change the bit that reads something like
Code:
<%=(Recordset1_total)%><%=(Recordset1.Fields.Item(&quot;Max_bookings&quot;).Value)%>
to read something like this:

Code:
<%
intBookingsLeft = (Recordset1.Fields.Item(&quot;Max_bookings&quot;).Value - Recordset1_total)
%>
<%=intBookingsLeft%>

Hope that makes sense and you can follow my logic

Cheech

[Peace][Pipe]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top