Home All Groups Group Topic Archive Search About

Reference to a control, by its name in a String

Author
22 Jun 2006 2:49 PM
Manekurt
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.Enabled = True
-----


any ideas, thank you !!

Manek

Author
22 Jun 2006 2:54 PM
Tim
me.controls("a1").enabled





Manekurt wrote:
Show quoteHide quote
> 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.Enabled = True
> -----
>
>
> any ideas, thank you !!
>
> Manek
Author
22 Jun 2006 3:00 PM
Mike Lowery
You need to write your own function to do this.  See
http://www.devx.com/vb2themax/Tip/19623.

Show quoteHide quote
"Manekurt" <mar_c_o_***@gamacom.com.ar> wrote in message
news:%23DDoCsglGHA.2136@TK2MSFTNGP04.phx.gbl...
> 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.Enabled = True
> -----
>
>
> any ideas, thank you !!
>
> Manek
>
>
>
Author
22 Jun 2006 3:00 PM
Patrice
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_***@gamacom.com.ar> a écrit dans le message de news:
%23DDoCsglGHA.2***@TK2MSFTNGP04.phx.gbl...
Show quoteHide quote
> 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.Enabled = True
> -----
>
>
> any ideas, thank you !!
>
> Manek
>
>
>
Author
22 Jun 2006 6:03 PM
Manekurt
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.NAMEOFCONTROLFROMMENUITEMNAME.enabled = ACCESS

Thank you




Show quoteHide quote
"Patrice" <scr***@chez.com> escribió en el mensaje
news:elvejyglGHA.3816@TK2MSFTNGP02.phx.gbl...
> 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_***@gamacom.com.ar> a écrit dans le message de news:
> %23DDoCsglGHA.2***@TK2MSFTNGP04.phx.gbl...
>> 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.Enabled = True
>> -----
>>
>>
>> any ideas, thank you !!
>>
>> Manek
>>
>>
>>
>
>