Snowflake68
Registered User.
- Local time
- Today, 11:04
- Joined
- May 28, 2014
- Messages
- 464
Hi have a text box on a form that needs to display the name of a Shift from a lookup table based upon the values in 8 different combo boxes containing a time value (eg. 08:00:00 formatted to Short Time, so displays only 08:00).
I can get the criteria to work separately using the following 8 lines but I need to join them together using AND as all values need to match to display the correct Shift description.
I have tried to join them together using the first two lines as an example (see below) but it returns the wrong Shift Description so I must have the syntax wrong.
Can someone help me with the correct syntax please.
Thanks in advance
Caz
I can get the criteria to work separately using the following 8 lines but I need to join them together using AND as all values need to match to display the correct Shift description.
Code:
=DLookUp("[Shift]","[LookupPreSetShifts]","[Set_AmShiftStart] =[cboAmShiftStart]")
=DLookUp("[Shift]","[LookupPreSetShifts]","[Set_AmShiftEnd] =[cboAmShiftEnd]")
=DLookUp("[Shift]","[LookupPreSetShifts]","[Set_PmShiftStart] =[cboPmShiftStart]")
=DLookUp("[Shift]","[LookupPreSetShifts]","[Set_PmShiftEnd] =[cboPmShiftEnd]")
=DLookUp("[Shift]","[LookupPreSetShifts]","[Set_Fri_AmShiftStart] =[cboFriAmShiftStart]")
=DLookUp("[Shift]","[LookupPreSetShifts]","[Set_Fri_AmShiftEnd] =[cboFriAmShiftEnd]")
=DLookUp("[Shift]","[LookupPreSetShifts]","[Set_Fri_PmShiftStart] =[cboFriPmShiftStart]")
=DLookUp("[Shift]","[LookupPreSetShifts]","[Set_Fri_PmShiftEnd] =[cboFriPmShiftEnd]")
I have tried to join them together using the first two lines as an example (see below) but it returns the wrong Shift Description so I must have the syntax wrong.
Code:
=DLookUp("[Shift]","[LookupPreSetShifts]","[Set_AmShiftStart] = [cboAmShiftStart]" And "[Set_AmShiftEnd] = [cboAmShiftEnd]")
Thanks in advance
Caz