Hello
Well I tested many things but I still have the same error flashing
Access tells me that a semicolon missing from the end of my SQL statement
I think it is possible that it comes from DoCmd.RunSQL and its syntax.
Here is my code
Code:
Private Sub Commande21_Click()
We Error GoTo Err_Commande21_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord,, acMenuVer70
Sun swn
swn = Me.N° _swnitch.Value
Sun cp
cp = 1
Do While cp <= Me.Nombre_de_ports.Value
DoCmd.RunSQL "INSERT INTO T_PORT (Port) VALUES ( '" & & Cpte " ') WHERE [No. swnitch.Value] = & & swn"";"
cp cp = + 1
Loop
End
Exit_Commande21_Click:
Exit Sub
Err_Commande21_Click:
MsgBox Err.Description
Resume Exit_Commande21_Click
End Sub
Bookmarks