Bonjour
J'ai créé un menu général avec l'utilitaire de base de données
Quand je veux l'ouvrir j'ai une erreur 429 "Un composant activeX ne peut pas créer d'objet"
En débogage la ligne incriminée est celle-ci
Set con = Application.CurrentProject.Connection
J'ai vérifié les références de ma base sans succès
Tout fonctionne bien sauf ce menu
Je vous mets le code de la fonction crée qui bug

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
 
Private Sub FillOptions()
' Fill in the options for this switchboard page.
 
    ' The number of buttons on the form.
    Const conNumButtons = 8
 
    Dim con As Object
    Dim rs As Object
    Dim stSql As String
    Dim intOption As Integer
 
    ' Set the focus to the first button on the form,
    ' and then hide all of the buttons on the form
    ' but the first.  You can't hide the field with the focus.
    Me![Option1].SetFocus
    For intOption = 2 To conNumButtons
        Me("Option" & intOption).Visible = False
        Me("OptionLabel" & intOption).Visible = False
    Next intOption
 
    ' Open the table of Switchboard Items, and find
    ' the first item for this Switchboard Page.
    Set con = Application.CurrentProject.Connection
    stSql = "SELECT * FROM [Switchboard Items]"
    stSql = stSql & " WHERE [ItemNumber] > 0 AND [SwitchboardID]=" & Me![SwitchboardID]
    stSql = stSql & " ORDER BY [ItemNumber];"
    Set rs = CreateObject("ADODB.Recordset")
    rs.Open stSql, con, 1   ' 1 = adOpenKeyset
 
    ' If there are no options for this Switchboard Page,
    ' display a message.  Otherwise, fill the page with the items.
    If (rs.EOF) Then
        Me![OptionLabel1].Caption = "Il n'y a aucun élément pour cette page de Menu Général"
    Else
        While (Not (rs.EOF))
            Me("Option" & rs![ItemNumber]).Visible = True
            Me("OptionLabel" & rs![ItemNumber]).Visible = True
            Me("OptionLabel" & rs![ItemNumber]).Caption = rs![ItemText]
            rs.MoveNext
        Wend
    End If
 
    ' Close the recordset and the database.
    rs.Close
    Set rs = Nothing
    Set con = Nothing
End Sub
Merci pour votre aide