My Working Query In VBA
My VBA Code (not working)"Code:DELETE * FROM tblRosterRec WHERE ID <> (SELECT Max(ID) AS MaxOfID FROM tblRosterRec AS Dupe WHERE (Dupe.EmpID = tblRosterRec.EmpID) AND (Dupe.Date_ = tblRosterRec.Date_));
Error:Code:Dim sSQL As String sSQL = "DELETE * " & _ "FROM tblRosterRec " & _ "WHERE ID <> (SELECT Max(ID) AS MaxOfID FROM tblRosterRec AS Dupe" & _ "WHERE (Dupe.EmpID = tblRosterRec.EmpID)" & _ "AND (Dupe.Date_ = tblRosterRec.Date_));" CurrentDb.Execute (sSQL)
![]()