Bonjour,
J'ai plusieurs formulaire qui vont beaucoup ce ressembler et vont utiliser le même type de fonction. J'ai dopnc décidé d'implémenter ces fonctions dans un module. Je vous met mon code et je m'explique :
Maintenant je veux appeler ce code dans un formulaire :
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 Public Sub EditEtat(Formul As Form) With Formul .AllowAdditions = False .AllowDeletions = False .AllowEdits = True .DataEntry = False End With End Sub Public Sub ViewEtat(Formul As Form) With Formul .AllowAdditions = False .AllowDeletions = False .AllowEdits = False .DataEntry = False End With End Sub Public Sub NewEtat(Formul As Form) With Formul .AllowAdditions = True .AllowDeletions = True .AllowEdits = True .DataEntry = True End With End Sub
Cependant ça ne marche pas, j'ai apparement une incompatibilité de type que je ne comprend pas !
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 Private Sub formulaireChanges() If [déclaration variable].modeTest = "Edit" Then Actions.EditEtat (Me) End If If [déclaration variable].modeTest = "View" Then Actions.ViewEtat (Me) End If If [déclaration variable].modeTest = "New" Then Actions.NewEtat (Me) End If End Sub
Merçi d'avance à ceux qui pourront m'aider !
Partager