473,770 Members | 6,105 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Double Booking on Microsoft Access.

1 New Member
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 4576
Armenante
5 New Member
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 Contributor
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("Dentist ID","tblAppoint ments","Dentist ID = [forms]![frmAddAppointme nt]![DentistID] AND AppointmentDate = [forms]![frmAddApoointme nts]![AppointmentDate] AND AppointmentTime = [forms]![frmAddApoointme nts]![AppointmentTime]")

if IsNull(DentistC heck) 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
noelf21
1 New Member
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
2445
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 booked cannot be booked again, i.e. cannot be booked in that date range Any help will be much appreciated
2
8239
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 group, subject and software) and analysis of bookings is a nightmare. I just fancied pottering with Access, which I am pretty familiar with, to see if I could create a means of booking a room using a database. Locking a booking would then be a...
20
1690
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 equal to 11."
0
1571
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 performamce. I have a constructed a query between the booking, event and peformance tables and created a subform on the booking form. The event table is linked to the performance table which in turn is linked to the booking table. I keep on getting the...
4
2769
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 booked. In tblbookings i have a room_number, booking_start_date and booking_end_date Ive tried all sorts of code but it either brings up an error or doesnt do anything at all. Hoping someone can help. Ive got as far as bringing up a...
25
2866
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 tblPersonaldetails -- -Autonumber, etc tblOutingDetails -- -Autonumber, etc
6
2556
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
2256
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: customer id(primary key) last name (text)
3
4660
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 particular truck so that when a new entry is being added, if the LoadDate and LoadTime doubles up with an existing entry I can flag it to the user?
0
10231
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10059
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10005
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8887
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5452
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3972
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2817
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.