Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional saving of records

Status
Not open for further replies.

jaydeebe

IS-IT--Management
Nov 14, 2003
169
GB
I am making a resource scheduler. It currently asks a user for input and then asks them to confirm the details. This is where it saves the record. I would like to check if the times of the booking overlap with any other bookings for the same resource that have already been saved. How might I achieve this?

Jaydeebe BSC (hons) MCP
 
Have a look at the BeforeUpdate event. This fires as the form starts to save the record and lets you cancel the save if you need to.

hth

Ben

----------------------------------------------
Ben O'Hara "Where are all the stupid people from...
...And how'd they get so dumb?"
rockband.gif
NoFX-The Decline
----------------------------------------------
 
My problem is comparing ranges for overlap

I think it needs to be something like this

Compare against all records in table.

If resource_name = resource_name
and Start_date>= Start_date but <enddate
or End_date>= Start_date but <enddate
and Start_time>= Start_time but <end_time
or end_time<end_time and end_time>start_time
then msgbox "Booking overlap, No save"


Jaydeebe BSC (hons) MCP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top