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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dblookup and removing double booking

Status
Not open for further replies.

RicCross

Programmer
Dec 4, 2001
19
0
0
GB
Hello i hope some one help me out

im new to programming and access so please forgive me for being stuipid.

I made an access 2000 database for a booking system for a confrence room.
I have a table called tblbooking
in that table there is :
date, start_time, Finish_time

I have a form called f_booking that the user can add a new booking.
the form has the following boxes : txtdate,txtstart,txtfinish

after the user has added a new booking i would like it to check that there are no double bookings. I think this should go in the before update event of the form

I think I should be using a dblookup funition something like

If Not IsNull(DLookup(&quot;[Date]&quot;, &quot;booking&quot;, (&quot;[Date]=&quot; & Me!txtDate)AND( [start_time]=>txtstart AND [Finish_time] =< txtfinish )) Then
MsgBox &quot;Conflict&quot;
Else
MsgBox &quot; No conflict&quot;
End if

Pleases Help some one

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top