Please help me correct the following query:
SQL = \"insert into tblContract (Empid, Start1, Finish1, Store1, \" & _
\"Start2, Finish2, St
Just remove VALUES
:
SQL = "
INSERT INTO tblContract (Empid, Start1, Finish1, Store1, Start2, Finish2, Store2)
SELECT " & Me.txtEmpNo.Value & "', MAX(testid), '" &
Me.txtContSunStart1.Value & "', '" & Me.txtContSunFinish1.Value & "','" &
Me.txtContSunStore1.Value & "','" & Me.txtContSunStart2.Value & "', '" &
Me.txtContSunFinish2.Value & "','" & Me.txtContSunStore2.Value & "' " &
"FROM tbltesting'"
Since you have 7
target fields and 8
SELECT
list expressions, this won't compile until you provide an extra field in the INSERT
clause where you want your MAX(testid)
to go to.