erreur '424' sur l'exécution sur clic d'un groupe d'option
Le
skdeesse

Bonjour,
J'ai créé un formulaire sur lequel j'ai un groupe d'option nommé "opgchoixsection" sur l'événement au click j'ai affecté la procédure événementielle suivante:
sachant que Correction et Fabrication sont des tables déjà créées
selon case 1,2,3 sélectionné je crée un nouveau enregistrement dans la table Correction en pour avoir Correction.datefab =Max(Fabrication.datefab) et Correction.section= section(1 ou 2 ou 3)
Private Sub opgchoixsection_click()
Dim strSQL As String
Select Case Me.opgchoixsection.Value
Case 1
strSQL = "INSERT INTO Correction([datefab], [section])SELECT (#" & Fabrication.datefab & "#, '" & section1 & "'As Expr1) FROM Fabrication"
strSQL = strSQL & "WHERE Fabrication.datefab = MAX(Fabrication.datefab)"
CurrentDb.Execute (strSQL)
Case 2
strSQL = "INSERT INTO Correction([datefab], [section])SELECT (#" & Fabrication.datefab & "#, '" & Section & "'As Expr2) FROM Fabrication"
strSQL = strSQL & "WHERE Fabrication.datefab = MAX(Fabrication.datefab)"
CurrentDb.Execute (strSQL)
Case 3
strSQL = "INSERT INTO Correction([datefab], [section])SELECT (#" & Fabrication.datefab & "#, '" & section3 & "'As Expr3) FROM Fabrication"
strSQL = strSQL & "WHERE Fabrication.datefab = MAX(Fabrication.datefab)"
CurrentDb.Execute (strSQL)
Case Else
MsgBox ("cochez la section concernée")
End Select
Exit Sub
End Sub
J'ai créé un formulaire sur lequel j'ai un groupe d'option nommé "opgchoixsection" sur l'événement au click j'ai affecté la procédure événementielle suivante:
sachant que Correction et Fabrication sont des tables déjà créées
selon case 1,2,3 sélectionné je crée un nouveau enregistrement dans la table Correction en pour avoir Correction.datefab =Max(Fabrication.datefab) et Correction.section= section(1 ou 2 ou 3)
Private Sub opgchoixsection_click()
Dim strSQL As String
Select Case Me.opgchoixsection.Value
Case 1
strSQL = "INSERT INTO Correction([datefab], [section])SELECT (#" & Fabrication.datefab & "#, '" & section1 & "'As Expr1) FROM Fabrication"
strSQL = strSQL & "WHERE Fabrication.datefab = MAX(Fabrication.datefab)"
CurrentDb.Execute (strSQL)
Case 2
strSQL = "INSERT INTO Correction([datefab], [section])SELECT (#" & Fabrication.datefab & "#, '" & Section & "'As Expr2) FROM Fabrication"
strSQL = strSQL & "WHERE Fabrication.datefab = MAX(Fabrication.datefab)"
CurrentDb.Execute (strSQL)
Case 3
strSQL = "INSERT INTO Correction([datefab], [section])SELECT (#" & Fabrication.datefab & "#, '" & section3 & "'As Expr3) FROM Fabrication"
strSQL = strSQL & "WHERE Fabrication.datefab = MAX(Fabrication.datefab)"
CurrentDb.Execute (strSQL)
Case Else
MsgBox ("cochez la section concernée")
End Select
Exit Sub
End Sub