Bonjour,
Je réalise une fonction de traduction qui récupère la liste des éléments et en fonction du type d'élément change le caption ou le text.
En cas d'erreur sur un élément, je réalise un Log et poursuit.
Cela fonctionne pour la 1ère erreur, mais plante lors d'une deuxième erreur, et je ne vois pas pourquoi.
L'erreur est remonté que je sois en débeugage ou diretement sur l'exe.
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
47
48
49
50 While Not Rs1.EOF NomFenetre = Rs1.Fields("NomFenetre") NomLibChamp = "LibElem" LibElem = Rs1.Fields(NomLibChamp) IndexElem = Rs1.Fields("IndexElem") TypeElem = Rs1.Fields("FkIdTypeElem").Value If IdLangue = 0 Then Caption = Rs1.Fields("Caption") If IdLangue = 1 Then Caption = Rs1.Fields("Caption2nd") On Error GoTo GestErreurElem TraitementOk = False Trouve = False For i = 0 To Forms.Count - 1 If Forms(i).Name = NomFenetre Then Set MaFenetre = Forms(i) Trouve = True End If Next i If Trouve Then Select Case TypeElem Case TypeElem_Command If IndexElem = -1 Then Set MonCommand = MaFenetre.Controls(LibElem) Else Set MonCommand = MaFenetre.Controls(LibElem)(IndexElem) End If MonCommand.Caption = Caption Case TypeElem_Label If IndexElem = -1 Then Set MonLabel = MaFenetre.Controls(LibElem) Else Set MonLabel = MaFenetre.Controls(LibElem)(IndexElem) End If MonLabel.Caption = Caption End Select End If TraitementOk = True GestErreurElem: If Not TraitementOk Then AjoutLOG TypeLog_Appli, "Traduction Elem" + LibElem + " de " + NomFenetre + " échouée" End If On Error GoTo 0 Rs1.MoveNext Wend
Merci
FRED
Partager