Bonjour à tous
Voulant tester une fonction de modification des menus de démarrage par Vba, j'ai introduit la fonction suivantePour tester cette fonction j'ai supprimé une propriété par
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 Private Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Boolean Dim db As Database Dim prp As Property Const conPropNotFoundError = 3270 'erreur si propriété existe On Error GoTo Change_Err Set db = CurrentDb db.Properties(strPropName) = varPropValue ChangeProperty = True Exit Function Change_Err: If Err = conPropNotFoundError Then 'crèe la propriété Set prp = db.CreateProperty(strPropName, varPropType, varPropValue) db.Properties.Append prp Resume Next Else ChangeProperty = False Exit Function End If End FunctionPuis j'ai lancé ma fonction par
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2myDatabase.Properties.Delete "AllowFullMenus"
Or j'ai une erreur 13 "Incompatibilité de type" sur la ligne
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 Public Function CreateProperty() Call ChangeProperty("AllowFullMenus", dbBoolean, False) End FunctionJ'ai beau chercher, je ne trouve pas l'erreur. Y a t'il une référence particulière à ajouter?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 Set prp = db.CreateProperty(strPropName, varPropType, varPropValue
D'avance merci à tous.
Partager