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?
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?