I'm trying to set the control source of a textbox on a form with the following:
But it gives #Error. Is it the quotation marks?
[DateOccupied} is a textbox (format short date)
StartDate and EndDate are fields in my table tblTEMPEventRooms (short date)
StartDateTime is a field in the same table (medium time)
Code:
=IIf(DLookUp("[Room]","tblTEMPEventRooms","WHERE #" & Me.DateOccupied & "# BETWEEN [StartDate] and [EndDate]) AND [StartDateTime] =8")=122,1,0)
[DateOccupied} is a textbox (format short date)
StartDate and EndDate are fields in my table tblTEMPEventRooms (short date)
StartDateTime is a field in the same table (medium time)