Bonjour,
je me heurte a un gros problème. Je veut ajouter des information dans une liste, cependent certaine de ses informations me donne :
Erreur d'exécution '6015'
Impossible d'ajouter cet élément. L'index est trop grand.
Je n'arrive pas a trouver le bug...
Le bug se produit lorsque que je tente d'inséré dans ma liste mes donnée (elle peut se produire sur l'une des deux lignes surligné). Le plus compliquer est que se problème ne se produit que pour certaine donnée.
A savoir que je travail sur une base de donnée dont les donnée peuvent être erronée, mais la je ne saisie pas le problème. Si quelqu'un a une idée je prend
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46 sql4 = "SELECT DTE,NUM,REF_CDE FROM CLI_CLE WHERE ID_CLI = " & Me.idcli & " AND ACTCUT=True AND DTE_RET IS NULL;" Set rst = CurrentDb.OpenRecordset(sql4) rst.MoveLast For i = 1 To rst.RecordCount sql6 = "SELECT MACHINE FROM CDE_DET WHERE REF_It = '" & rst!REF_CDE & "' AND log = '" & Me.lstlog.Column(0) & "';" Set rst2 = CurrentDb.OpenRecordset(sql6) If rst2.RecordCount = 0 Then mach = "" Else mach = rst2!machine End If 'Si la cle est reseau : sql10 = "SELECT id_cle, res FROM cli_cle WHERE num = " & rst!NUM & ";" Set rst3 = CurrentDb.OpenRecordset(sql10) sql12 = "SELECT dongle_bit FROM logiciels WHERE Id_log = " & Me.idlog & ";" Set rst4 = CurrentDb.OpenRecordset(sql12) If IsNull(rst4!dongle_bit) Then Me.lstdet.AddItem 1 & "; " & rst!Dte & ";" & rst!NUM & ";" & rst!REF_CDE & ";" & mach, i Else If rst3!RES = True And rst4!dongle_bit > 31 And rst4!dongle_bit < 48 Then sql11 = "SELECT quantite FROM cli_cle_res WHERE id_cle = " & rst3!ID_CLE & " AND id_log = " & Me.idlog & ";" Set rst5 = CurrentDb.OpenRecordset(sql11) sql13 = "SELECT COUNT(quantite) AS [nb] FROM cli_cle_res WHERE id_cle = " & rst3!ID_CLE & " AND id_log = " & Me.idlog & ";" Set rst6 = CurrentDb.OpenRecordset(sql13) nb = rst6!nb rst6.Close MsgBox mach MsgBox i If nb > 0 Then Me.lstdet.AddItem rst5!quantite & "; " & rst!Dte & ";" & rst!NUM & ";" & rst!REF_CDE & ";" & mach, i End If rst5.Close Else Me.lstdet.AddItem 1 & "; " & rst!Dte & ";" & rst!NUM & ";" & rst!REF_CDE & ";" & mach, i End If End If rst.MovePrevious rst2.Close rst3.Close rst4.Close Next i
Partager