Bonjour,
Je voudrais supprimer les objets (textbox, combobox etc.) dont les noms commencent par "_v"
ça marche, mais ce qui se passe c'est qu'une "grosse" erreur est déclenchée et la fenêtre (l'image en Pièce Jointe) est affichée et Access est fermer,
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 DoCmd.OpenForm "FormRootGeneric", acDesign i = 0 For Each vControl In Forms("FormRootGeneric").Controls If Left(vControl.Name, 2) = "_v" Then i = i + 1 End If Next vControl If (i <> 0) Then ReDim vControlTab(i - 1) i = 0 For Each vControl In Forms("FormRootGeneric").Controls If Left(vControl.Name, 2) = "_v" Then vControlTab(i) = vControl.Name i = i + 1 End If Next vControl For j = 0 To i - 1 DeleteControl "FormRootGeneric", vControlTab(j) Next j End If
Le plus étrange c'est que le fichier se dédouble et grossi à chaque fois ???!!!
Partager