Quick macro help?

Europe_Josh

New member
Local time
Today, 18:18
Joined
Mar 19, 2010
Messages
1
Ok, so i have a 3-way relational database. It is for booking certain courses for each customer for one particular week.

I have:
A Customer Table, with forename, surname and some other details etc.
tbl_CUSTOMER

A Courses Table, with course names, how much they cost and how many people are already booked for the course.
tbl_COURSES

Booking table, where customer details and course details are taken from the tables and placed into this one to make a booking
tbl_BOOKING

Then i have a form that shows all bookings for each customer, and lets the user add more bookings onto it.

I want a macro that can check that there is less than or equal to 20 places on the course they want to do, and then display a message either saying that there is already too many people on the course so they can't do it, or saying that the booking is confirmed. Also, the SpaceTaken field should have 1 added to it.

I'm absolutely useless with code, but I attempted it, and did this:

If SpaceTaken >= 20 Then MsgBox ("Sorry, there are no more places available.") Else MsgBox ("Booking Confirmed. There are " & SpaceTaken & " places taken.")
SpaceTaken = SpaceTaken + 1

(SpaceTaken is the amount of people already on the course)
however, this doesn't work. Any ways to fix/scrap and start again so it works?

Also, can you change the booking confirmed messagebox to tell the user how many places are still available?
 
welcome to the forum,

Have you thought initially to have a label showing how many places are available then add a total through a text box that will sum the places taken, then look to take one from the other and then have the message being displayed as a label depending on the results.

Sometimes expressions are easier than thinking of code.

Can you post a sample of the database and someone will take a look and add the necessary to your form.
 

Users who are viewing this thread

Back
Top Bottom