Bonjour,
Suite à l'étude de vos tutoriels je dégage un code, utilisant Database.Execute ( Database étant oDb dans mon code) hors au cours de son éxécution une erreur survient:
Erreur d'execution 3601
Trop peu de paramétre 1 attendu.
Voyez vous une erreur dans mon code?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 Private Sub Bt_Modifier_Click() Dim Atelier As String Dim Section As Long Dim ID As Long Atelier = Txt_Atelier.Value Section = Txt_Section.Value ID = Lst_Atelier.Value If MsgBox("Voulez-vous confirmer la modification", vbQuestion + vbYesNo, "CONFIRMATION") = vbNo Then Exit Sub End If Dim oRst As DAO.Recordset Dim oDb As DAO.Database Set oDb = CurrentDb oDb.Execute "UPDATE T_Atelier SET Nom_Atelier =" & Txt_Atelier & " AND Section =" & Txt_Section & " WHERE ID_Atelier =" & ID & "" Debug.Print "Enregistrement affecté = " & oDb.RecordsAffected oRst.Close oDb.Close Set oRst = Nothing Set oDb = Nothing End Sub
Partager