Run time error 3075

G

Guest

Can anyone help me with this one

I have a form with a button to check if any booking details clash [btnBook], this is the code behind the button

If IsNull(DLookup("[Aircraft]", "BookingDetails", "([Aircraft] = " & cboAircraft & " AND [HireDate] = #" &
cboHireDate & "#) AND ((#" & cboStartTime & "# BETWEEN [StartTime] AND [EndTime]) AND (#" &
cboEndTime & "# BETWEEN [StartTime} AND [EndTime]))")) The

txtConfirm.Text = "Your booking is confirmed" ' Dlookup returns Null = No record foun
Els
txtConfirm.Text = "Please Choose another Aircraft, Date, Time" 'DLookup found a record
End I

End Su

My problem is at runtime i get the following error message under run time error '3075

Between operator without AND in query expression '([Aircraft] = G-BGIG AND [HireDate] = #17/03/2004#) AND
((#08:00:00# BETWEEN [StartTIme] AND [EndTime]) AND (#10:00:00# BETWEEN [StartTime] AND [EndTime]))

Am i missing an AND or an operator - i can't figure it out

Any ideas....anyone?

Thanks in advanc
 
P

Peter Hoyle

If IsNull(DLookup("[Aircraft]", "BookingDetails", "([Aircraft] = " &
cboAircraft & " AND [HireDate] = #" & _
cboHireDate & "#) AND ((#" & cboStartTime & "# BETWEEN [StartTime] AND [EndTime]) AND (#" & _
cboEndTime & "# BETWEEN [StartTime} AND [EndTime]))")) Then

I haven't checked this out thoroughly but if you pasted
the above code then you need to look at the bracket after the last
[StartTime}<<

Cheers,
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top