I want to make a request which will insert data or update if the entry exists.
I tried:
Set rs = CurrentDb.OpenRecordset("SELECT * FROM dbo_VUE_GATE_ELEVES WHERE Annee = " & intAnneeScolaire)
While Not rs.EOF
DoCmd.RunSQL ("INSERT INTO Eleve(Fiche, Nom, Prenom, Courriel) VALUES (rs!Fiche, '" & rs!Nom & "', '" & rs!Prenom & "', '" & rs!Courriel & "') ON DUPLICATE KEY UPDATE Nom = '" & rs!Nom & "', Prenom = '" & rs!Prenom & "', Courriel = '" & rs!Courriel & "'")
rs.MoveNext
Wend
I always get the following error:
"Error 3137 - Missing semicolon(;) at end of SQL statement."
And yes I tried adding a semicolon. Thanks for your help!