I am getting the above error when I try to run this union query and I cannot find what's wrong with the sql:
SELECT Mid(Table1.DEPT,2,2) AS STORE, Table1.DEPT, Table1.NAME, tbl_Accrual_Holidays.FILE, tbl_Accrual_Holidays.HOL, tbl_Accrual_Holidays.HOURS, tbl_Accrual_Holidays.DATE_ADDED, tbl_Accrual_Holidays.DCTRL, Table1.UNION FROM tbl_Accrual_Holidays INNER JOIN Table1 ON tbl_Accrual_Holidays.FILE=Table1.FILE WHERE (((tbl_Accrual_Holidays.HOL)=IIf(Forms!frm_HolidaySelection.Form!cboHolidayList="New Year's Day","NY" & Right(Year(Now())+1,2),DLookUp("
SELECT Mid(Table1.DEPT,2,2) AS STORE, Table1.DEPT, Table1.NAME, tbl_Accrual_Holidays.FILE, tbl_Accrual_Holidays.HOL, tbl_Accrual_Holidays.HOURS, tbl_Accrual_Holidays.DATE_ADDED, tbl_Accrual_Holidays.DCTRL, Table1.UNION FROM tbl_Accrual_Holidays INNER JOIN Table1 ON tbl_Accrual_Holidays.FILE=Table1.FILE WHERE (((tbl_Accrual_Holidays.HOL)=IIf(Forms!frm_HolidaySelection.Form!cboHolidayList="New Year's Day","NY" & Right(Year(Now())+1,2),DLookUp("
Code:
","[tbl_CalendarHolidays]","[HOLIDAY] = '" & Forms!frm_HolidaySelection!cboHolidayList & "'") & Right(Year(Now()),2))))
ORDER BY Mid(Table1.DEPT,2,2), Table1.DEPT, Table1.NAME;
It worked fine in Access 2000, but our Office was recently upgraded to 2003, and that is when this error started appearing. Any help is appreciated...pulling hairs.
Rey