IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Access Discussion :

Groupname propriété non accessible.


Sujet :

Access

  1. #1
    Membre régulier
    Profil pro
    Inscrit en
    Avril 2009
    Messages
    137
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Avril 2009
    Messages : 137
    Points : 92
    Points
    92
    Par défaut Groupname propriété non accessible.
    bonjour à tous/toutes,

    j'utilise du VBA pour créer mes formulaires dans access mais je n'arrive pas à configurer la propriété groupname. Je contourne le problème en mettant à false l'un ou les optionbutton lors de l'event onclick (pas en place de le code ci-dessous). Auriez vous des pistes ou une explication pourquoi est ce que je ne peux accéder à cette propriété ?

    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
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    Sub clt_form()
        Dim frm As Form
    	dim ctrl as controls
        Dim frmName As String
        Dim labelProperties As Label
        Dim txtBox As TextBox
        Dim Opt_button As optionbutton
     
        Set frm = CreateForm
        frm.PopUp = True
        frm.Caption = "Client Input"
        frmName = frm.Name
     
        'standard size for label and textbox
        Dim label_size_1 As Integer
        Dim label_size_2 As Integer
        Dim textbox_size_1 As Integer
        Dim standard_space_leftAlign As Integer
        Dim standard_space_topAlign As Integer
        Dim align_left As Integer
        Dim align_top As Integer
        Dim default_height As Integer
     
        align_left = 1000
        label_size_1 = 3000
        label_size_2 = 5000
        label_size_3 = 1000 ' option button	
     
        textbox_size_1 = 5000 'text
        textbox_size_2 = 1000 'numéros
     
        standard_space_leftAlign = 500
        default_height = 300
     
        align_top = 2000
        standard_space_topAlign = 500
        Dim ctrl As Control
     
        ' les entrées sont toujour groupées par 3, label nom du champ, l'input (inputbox, radio button ... Et erreur sur le champ en label)
     
        'Nom du formulaire
     
        Set labelProperties = CreateControl(frm.Name, acLabel, , , , align_left, 1000, 10000, 300)
        labelProperties.Caption = "Formulaire - Enregistrement d'un nouvel employé"
     
        labelProperties.FontBold = True
        labelProperties.ForeColor = RGB(86, 118, 157)
     
        ' nom
            Set labelProperties = CreateControl(frm.Name, acLabel, , , , align_left, align_top, label_size_1, default_height)
            labelProperties.Caption = "Nom :"
     
            Set txtBox = CreateControl(frm.Name, acTextBox, , , , align_left + label_size_1 + standard_space_leftAlign, align_top, textbox_size_1, default_height)
            txtBox.Name = "clt_nom"
     
            Set labelProperties = CreateControl(frm.Name, acLabel, , , , align_left + label_size_1 + standard_space_leftAlign + textbox_size_1 + standard_space_leftAlign, align_top, label_size_2, default_height)
            labelProperties.Caption = ""
            labelProperties.Name = "clt_label_nom"
            labelProperties.ForeColor = RGB(237, 28, 36)
            labelProperties.Visible = False
     
            'on ajoute l'espacement pour la ligne suivante
            align_top = align_top + standard_space_topAlign
     
        'prénom
            Set labelProperties = CreateControl(frm.Name, acLabel, , , , align_left, align_top, label_size_1, default_height)
            labelProperties.Caption = "Prénom :"
     
            Set txtBox = CreateControl(frm.Name, acTextBox, , , , align_left + label_size_1 + standard_space_leftAlign, align_top, textbox_size_1, default_height)
            txtBox.Name = "clt_prenom"
     
            Set labelProperties = CreateControl(frm.Name, acLabel, , , , align_left + label_size_1 + standard_space_leftAlign + textbox_size_1 + standard_space_leftAlign, align_top, label_size_2, default_height)
            labelProperties.Caption = ""
            labelProperties.Name = "clt_label_prenom"
            labelProperties.ForeColor = RGB(237, 28, 36)
            labelProperties.Visible = False
     
            'on ajoute l'espacement pour la ligne suivante
            align_top = align_top + standard_space_topAlign
     
        ' Option button adresse propre ou domicilié chez quelqu'un
     
            Set labelProperties = CreateControl(frm.Name, acLabel, , , , align_left, align_top, label_size_1, default_height)
            labelProperties.Caption = "Domicilié chez quelqu'un ?"
     
            Set controls = CreateControl(frm.Name, acOptionButton, , , , align_left + label_size_1 + standard_space_leftAlign, align_top, label_size_3, default_height)
            controls.groupname = "OB_1"
    		controls.Name = "clt_domicilie_y"
     
            Set controls = CreateControl(frm.Name, acOptionButton, , , , align_left + label_size_1 + label_size_3 + standard_space_leftAlign, align_top, label_size_3, default_height)
            controls.groupname = "OB_1"
    		controls.Name = "clt_domicilie_y"
     
            Set labelProperties = CreateControl(frm.Name, acLabel, , , , align_left + label_size_1 + standard_space_leftAlign + textbox_size_1 + standard_space_leftAlign, align_top, label_size_2, default_height)
            labelProperties.Caption = ""
            labelProperties.Name = "clt_label_domcilie"
            labelProperties.ForeColor = RGB(237, 28, 36)
            labelProperties.Visible = False
     
            'on ajoute l'espacement pour la ligne suivante
            align_top = align_top + standard_space_topAlign
     
     
     
        DoCmd.RunCommand acCmdFormView
    End Sub
    et voici le bout de code qui me pose soucis, impossible d'accéder à cette propriété groupname (en optionbutton ou en control)

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
     
     
            Set controls = CreateControl(frm.Name, acOptionButton, , , , align_left + label_size_1 + standard_space_leftAlign, align_top, label_size_3, default_height)
            controls.groupname = "OB_1"
    		controls.Name = "clt_domicilie_y"
     
            Set Opt_button = CreateControl(frm.Name, acOptionButton, , , , align_left + label_size_1 + label_size_3 + standard_space_leftAlign, align_top, label_size_3, default_height)
            Opt_button.groupname = "OB_1"
    		Opt_button.Name = "clt_domicilie_y"
    Merci d'avance à ceux qui prendront le temps de répondre.

  2. #2
    Expert confirmé
    Homme Profil pro
    retraité
    Inscrit en
    Juin 2012
    Messages
    3 230
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations professionnelles :
    Activité : retraité
    Secteur : Associations - ONG

    Informations forums :
    Inscription : Juin 2012
    Messages : 3 230
    Points : 5 595
    Points
    5 595
    Par défaut
    Peut-être un début de solution sur ce post:
    http://www.developpez.net/forums/d35...boutons-radio/

    Bonne continuation.

Discussions similaires

  1. [AC-2007] Feuille des propriétés, non accessible et ne s'affiche pas
    Par Lionel de Genève dans le forum VBA Access
    Réponses: 20
    Dernier message: 21/02/2017, 14h38
  2. Réponses: 2
    Dernier message: 13/10/2009, 14h57
  3. Réponses: 2
    Dernier message: 15/10/2007, 17h53
  4. Constructeur non accessible
    Par mathieu dans le forum C++
    Réponses: 1
    Dernier message: 03/09/2006, 23h43
  5. Constructeur non accessible
    Par mathieu dans le forum C++
    Réponses: 12
    Dernier message: 06/08/2004, 01h56

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo