Bonsoir,
J'ai une erreur 91 "Variable objet ou variable bloc with non définie"...
Ce qui m'étonne c'est que le While... Wend fonctionne bien mais lors du dernier enregistrement avant EOF il retourne sur WHILE et c'est là qu'il affiche le message d'erreur:
Voici mon code:
Ou ai je fauté???
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 Set db = Nothing Set rst = Nothing SQL = "SELECT [T_ACI].[CL_2] FROM [T_ACI] WHERE [T_ACI].[LCN associé] = '" & LCN & "' AND [CL_1] = 'M01';" Set db = CurrentDb Set rst = db.OpenRecordset(SQL, dbOpenDynaset) While Not rst.EOF For i = 1 To Nb rst.Edit rst.Fields("CL_2") = 10 * i rst.Update rst.MoveNext Next i rst.Close db.Close Set db = Nothing Set rst = Nothing Wend
Partager