I'm having trouble by solving a Key Violation when running a Append query.
The Query works fine when ever all the records in the table are removed but whenever any AttMed records in the table "Attend" I get the message of a KeyViolation but the query still Append the records I want it to but I still love for the Key Violation not to appear.
)
strSQL = "INSERT INTO Attend ( AttMed, AttTeam, AttDate, AttMeetTime, AttType )" _
& " SELECT Query3.MedID, Query3.TeamNo, Forms!frmHovedmenu!txtToday, Query3.MeetTime, 1" _
& " FROM Query3" _
& " WHERE (((Forms!frmHovedmenu!txtToday) AND Query3.MedID Not In (SELECT AttDate AND AttMed FROM Attend )));"
DoCmd.RunSQL strSQL
Hope u guys can help me
)
The Query works fine when ever all the records in the table are removed but whenever any AttMed records in the table "Attend" I get the message of a KeyViolation but the query still Append the records I want it to but I still love for the Key Violation not to appear.
strSQL = "INSERT INTO Attend ( AttMed, AttTeam, AttDate, AttMeetTime, AttType )" _
& " SELECT Query3.MedID, Query3.TeamNo, Forms!frmHovedmenu!txtToday, Query3.MeetTime, 1" _
& " FROM Query3" _
& " WHERE (((Forms!frmHovedmenu!txtToday) AND Query3.MedID Not In (SELECT AttDate AND AttMed FROM Attend )));"
DoCmd.RunSQL strSQL
Hope u guys can help me