C
clueless
I've read all there is on dlookup but can't find any examples where
dlookup has multiple expressions. Example : my db wants to check 1) If
two dates(arrive and depart) don't clash for 2) a room in the db,no
double bookingd. Worse even all the fields are on one form, so I'm not
looking for a field on a different table, that prt of dlookup i
understand.
I've already coded to ensure that data is inserted on these 3 fields
and tested the dates (depart>arrive = then error mgsbox).
Now I'm stuck on looking through the records for a clash and display
error message.
I've tried using RecordsetClone coding but it saves records even if
there are clashes.No error displays.
I've tried
Dim myLookup As Long
myLookup = dlookup("[roomId]","Bookings","[BookId]=" _
&dlookup("[arrive]<=[depart]","Bookings","[BookId]=")
This also saves the record and looks for nothing.
I am officially confused. Can somebody please help explain what I'm
doing wrong. Or should I be using an If statement instead of lookup.
Thank You.
dlookup has multiple expressions. Example : my db wants to check 1) If
two dates(arrive and depart) don't clash for 2) a room in the db,no
double bookingd. Worse even all the fields are on one form, so I'm not
looking for a field on a different table, that prt of dlookup i
understand.
I've already coded to ensure that data is inserted on these 3 fields
and tested the dates (depart>arrive = then error mgsbox).
Now I'm stuck on looking through the records for a clash and display
error message.
I've tried using RecordsetClone coding but it saves records even if
there are clashes.No error displays.
I've tried
Dim myLookup As Long
myLookup = dlookup("[roomId]","Bookings","[BookId]=" _
&dlookup("[arrive]<=[depart]","Bookings","[BookId]=")
This also saves the record and looks for nothing.
I am officially confused. Can somebody please help explain what I'm
doing wrong. Or should I be using an If statement instead of lookup.
Thank You.