How do i do this?? -Confirmation of booking request

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi al

I have set up a booking form that has 3 combo boxes on it, one is for an aircraft registration, one for hire date, one a start time. (all information goes into tblBookingDetails

What i would like to do is when a user clicks a 'confirm hire button' (on the form [frmBooking]) the code behind it should look at the values contained in these boxes (or the table) and say whether the booking is possible or not

Would i use a simple query (with the data from these boxes (i've set this up but can't figure out how to run it) or does it involve more coding?

Cam
 
It's all very nice to specify an aircraft, date and time, but how long is
someone going to be hiring this aircraft for? Where is the end time?

If IsNull(DLookup("[AircraftID]", "tblBooking Details", _
"(AircraftID = " & Me.cboAircraftID & _
" AND HireDate = #" & Me.cboHireDate & "#) AND (#" & Me.cboStartTime & _
"# BETWEEN [StartTime] AND [EndTime] OR #" & _
Me.cboEndTime & "# BETWEEN [StartTime] AND [EndTime]))) Then

'The booking is OK.
End If

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

C N said:
Hi all

I have set up a booking form that has 3 combo boxes on it, one is for an
aircraft registration, one for hire date, one a start time. (all
information goes into tblBookingDetails)
What i would like to do is when a user clicks a 'confirm hire button' (on
the form [frmBooking]) the code behind it should look at the values
contained in these boxes (or the table) and say whether the booking is
possible or not.
Would i use a simple query (with the data from these boxes (i've set this
up but can't figure out how to run it) or does it involve more coding??
 
Graham , thanks for the reply

To be honest i have an end time but i never thought of including it into the query, but thinking about it now how can somebody hire something if it is already out on hire!

DOH!!

Thanks for your thoughts and thanks for the pointer

Cam
 
Back
Top