473,387 Members | 1,579 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Double Booking on Microsoft Access.

I am creating a Dentist Booking form, for my A level project.

I have the following Tables:

Appointments
Appointment ID
Dentist ID
Patient ID
Appointment Date
Appointment Time
Appointment Type

Dentists
Dentist ID
Dentist Surname

Nurses
Nurse ID

Patients
Patients ID
Forename
Surname
Address line 1
Address line 2
Postcode
Phone number

Basically my problem is that in my data input forms, that i have created I need it to bring up an error message when a dentist is about to be double booked.

e.g.

If dentist 1 has an appointment on the 22/10/08 at 10:00 then that dentist can not be booked on that date and time again. but Dentist 2 and 3 can be.

I have tried to work this out for many hours and havnt really got close.

The system also has the following relationships



The avialble table is from my attempt to do this..it is irrelevant really it just contains the list of available times.

Thank you alot in advance to anyone who can help me, im sorry if there is repeated problems like this and threads all over the place. but i dont really have time to be searching for them and adapting them to my system.

if you feel the need to contact me :jwkey@hotmail.com
Dec 6 '07 #1
3 4546
Lol i asked the same question in this thread

http://www.thescripts.com/forum/thread745118.html

tried to convert the VBA from another thread but it is harder than it looks so sorry i can not help you, but i have exactly the same problem. So anyone that can help this guy out i would be greatful because it would help me out too.

Tom
Dec 6 '07 #2
Dan2kx
365 100+
if this information is selected from a form then you could use a dcount as such:
(dcount(what to count, where from, when a=b) (just in case you didnt know)

dim DentistCheck as integer

DentistCheck = DCount("DentistID","tblAppointments","DentistID = [forms]![frmAddAppointment]![DentistID] AND AppointmentDate = [forms]![frmAddApoointments]![AppointmentDate] AND AppointmentTime = [forms]![frmAddApoointments]![AppointmentTime]")

if IsNull(DentistCheck) or dentistcheck = 0 then
Exit sub (or add record or whatever)
else
Msgbox "this dentist already has a booking"
end if

That basically searches your appointment table and if it returns any records it will count them and then if there are any it will avoid the double book

Just a little tip for ya... take the spaces outta ya field names cos it does cause problems when coding, and prefix ur objects as not to confuse access...

Dan
Dec 6 '07 #3
just wondering would this also work for mine?

I have the following table booking, member, discount and facility

Booking table consists of Booking ID, Booking Time, Booking Date, Member ID, Facility ID, Discount ID
Dec 2 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Grant | last post by:
Hi I have a database which logs the usage of rooms. Some booking are entered well in advance, and some have stays of more than six months. I would like to ensure that rooms which have been...
2
by: Andy | last post by:
Hi folks I teach. At school, four IT rooms are booked using a paper based outline timetable. Completing it is easy but basic and impossible to ensure completion of all fields (name, year...
20
by: bredal Jensen | last post by:
Hello gurus, I'm building a small booking system and i have come accross quiet a tedious pitfall. "I need to make sure that people do not book for tomorrow when todays time is greater or...
0
by: thegame21 | last post by:
Hi, I am currently creating a cinema system using access where a booking can be made for a event. Each event when it is shown is categoriesd as a performance. A booking must be made for each...
4
by: markymark34 | last post by:
Im messing around trying to learn Access and have hit a problem. I have a table called tblbookings and i want to seach though it when trying to make a new booking to make sure the room isnt alrady...
25
by: NDayave | last post by:
How do, I have a access 2000 booking database with Personal Details, Outing Details and the Bookings in three tables: tblBookings -- -Autonumber, -Number, -Number, -Currency, -Yes/No, -Yes/No ...
6
by: iazahoor | last post by:
I use Access 2000 and I'm trying to figure out what VBA code to use to prevent double bookings. Any help on this matter will be greatly appreciated. Regards Immy
3
by: anotherjoe | last post by:
Question 1: I have reservation database in access 2007 I have a cabin information table with: cabinid (primarykey) cabinname(text) cabinlocation(text) I have a customer table with:...
3
by: Wayne | last post by:
I'm building a bookings database for trucks that among other things captures the TruckName, LoadDate, LoadTime, UnloadDate and UnloadTime. Is there a simple way to prevent double bookings for any...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.