Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
reservations form / overlapping appointments
Robert 

15 years ago
Hi, i created a customer form, with a reservation subform on it. This acts as my customer reservation form for inputting new customers and reservations, or adding a reservation to a current customer. IS there any way in which, once the property has been selected from a drop down menu, i can make it so that a specific date for that property can only be chosen once, so as reservations can not over lap/ run into each other, as double booking is a serious issue. There is already a property form, but it only displays info on the propery's physical attributes. thanks.



Richard Replies:

You could query your reservations table to see if there was already something booked for that date/time, but I warn you that this is going to involve a little programming.

For example, let's say that you have a date/time field called AppointmentTime. You want to see if there are any appointments in your table that fall on that exact date and time. In the AfterUpdate event for that field, you could say:

ID = DLOOKUP("AppointmentID","AppointmentT","StartTime=#" & AppointmentTime & "#")
If Not IsNull(ID) Then
   MsgBox "You've got another appointment scheduled at this time"
End If

This uses the DLOOKUP function to look in the table AppointmentT and see if there is a record with a StartTime equal to your AppointmentTime value. If so, it brings back it's AppointmentID. If not, you get a NULL.

Now, what you want to do is a little more complex, so you'd have to probably use DMAX and DMIN to see if appointments overlap each other, but it's not terribly different.

Here's a tutorial that will help you more with DLOOKUP if you would like to pursue this further:

http://599cd.com/tips/access/dlookup-function/?key=AlExBlg

It's one of the most powerful functions in Access. Once you master it, you really add a TON of flexibility to your databases/.

Hope this helps.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/22/2026 3:40:10 AM. PLT: 1s