Reference to a control, by its name in a String

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Manekurt

    #1

    Reference to a control, by its name in a String

    Hello to all, I need to change a property of a menuitem called for example
    A1
    I have A1 in a String Varibale

    I need to accomplish this
    ------
    Me.A1.Enabled = True
    ------


    in this way

    -----
    var_aname As String = "A1"
    Me.var_aname.En abled = True
    -----


    any ideas, thank you !!

    Manek



  • Tim

    #2
    Re: Reference to a control, by its name in a String


    me.controls("a1 ").enabled





    Manekurt wrote:[color=blue]
    > Hello to all, I need to change a property of a menuitem called for example
    > A1
    > I have A1 in a String Varibale
    >
    > I need to accomplish this
    > ------
    > Me.A1.Enabled = True
    > ------
    >
    >
    > in this way
    >
    > -----
    > var_aname As String = "A1"
    > Me.var_aname.En abled = True
    > -----
    >
    >
    > any ideas, thank you !!
    >
    > Manek[/color]

    Comment

    • Patrice

      #3
      Re: Reference to a control, by its name in a String

      This is the name of the control or the name of the variable ?

      Have you double checked you design ? You may want to explain what you is
      your final goal.

      --
      Patrice

      "Manekurt" <mar_c_o_sbv@ga macom.com.ar> a écrit dans le message de news:
      %23DDoCsglGHA.2 136@TK2MSFTNGP0 4.phx.gbl...[color=blue]
      > Hello to all, I need to change a property of a menuitem called for example
      > A1
      > I have A1 in a String Varibale
      >
      > I need to accomplish this
      > ------
      > Me.A1.Enabled = True
      > ------
      >
      >
      > in this way
      >
      > -----
      > var_aname As String = "A1"
      > Me.var_aname.En abled = True
      > -----
      >
      >
      > any ideas, thank you !!
      >
      > Manek
      >
      >
      >[/color]


      Comment

      • Mike Lowery

        #4
        Re: Reference to a control, by its name in a String

        You need to write your own function to do this. See
        http://www.devx.com/vb2themax/Tip/19623.

        "Manekurt" <mar_c_o_sbv@ga macom.com.ar> wrote in message
        news:%23DDoCsgl GHA.2136@TK2MSF TNGP04.phx.gbl. ..[color=blue]
        > Hello to all, I need to change a property of a menuitem called for example A1
        > I have A1 in a String Varibale
        >
        > I need to accomplish this
        > ------
        > Me.A1.Enabled = True
        > ------
        >
        >
        > in this way
        >
        > -----
        > var_aname As String = "A1"
        > Me.var_aname.En abled = True
        > -----
        >
        >
        > any ideas, thank you !!
        >
        > Manek
        >
        >
        >[/color]


        Comment

        • Manekurt

          #5
          Re: Reference to a control, by its name in a String

          Hello, I need to enable or not, menuitems in a menu depnending the user
          permission, whish is set in a table of the DB
          so I go through the table records, and depending the name of the control , y
          enable or not the menu
          Something like this

          TABLE PERMISSION
          MEUNUNAME - ACCESS
          A1 true
          A2 true
          A3 false
          A4 true

          Something like this
          So I need this

          me.NAMEOFCONTRO LFROMMENUITEMNA ME.enabled = ACCESS

          Thank you




          "Patrice" <scribe@chez.co m> escribió en el mensaje
          news:elvejyglGH A.3816@TK2MSFTN GP02.phx.gbl...[color=blue]
          > This is the name of the control or the name of the variable ?
          >
          > Have you double checked you design ? You may want to explain what you is
          > your final goal.
          >
          > --
          > Patrice
          >
          > "Manekurt" <mar_c_o_sbv@ga macom.com.ar> a écrit dans le message de news:
          > %23DDoCsglGHA.2 136@TK2MSFTNGP0 4.phx.gbl...[color=green]
          >> Hello to all, I need to change a property of a menuitem called for
          >> example A1
          >> I have A1 in a String Varibale
          >>
          >> I need to accomplish this
          >> ------
          >> Me.A1.Enabled = True
          >> ------
          >>
          >>
          >> in this way
          >>
          >> -----
          >> var_aname As String = "A1"
          >> Me.var_aname.En abled = True
          >> -----
          >>
          >>
          >> any ideas, thank you !!
          >>
          >> Manek
          >>
          >>
          >>[/color]
          >
          >[/color]


          Comment

          Working...