Reference to a control, by its name in a String

  • Thread starter Thread starter Manekurt
  • Start date Start date
M

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
 
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.
 
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
 
Back
Top