473,395 Members | 2,783 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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.Enabled = True
-----
any ideas, thank you !!

Manek

Jun 22 '06 #1
4 1118
Tim

me.controls("a1").enabled

Manekurt wrote:
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


Jun 22 '06 #2
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" <ma*********@gamacom.com.ar> a écrit dans le message de news:
%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

Jun 22 '06 #3
You need to write your own function to do this. See
http://www.devx.com/vb2themax/Tip/19623.

"Manekurt" <ma*********@gamacom.com.ar> wrote in message
news:%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

Jun 22 '06 #4
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


"Patrice" <sc****@chez.com> escribió en el mensaje
news:el**************@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" <ma*********@gamacom.com.ar> a écrit dans le message de news:
%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


Jun 22 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: michaelkatsilis | last post by:
Hi, Are there any issues with returning a const reference value for public "get" accessor methods? eg. const string & getVal(); // or const MyString & getVal();
2
by: Zippy | last post by:
Some months ago, we requested help from this newsgroup on how to replace the library reference of a database with another library reference, prior to creating an MDE. I got the following answer...
9
by: Moe Sizlak | last post by:
Hi There, I am trying to write the selected value of a listcontrol when a button is clicked and I keep getting the error "object not set to a reference of an object". The libox itself is in a...
2
by: Merlin | last post by:
Hi I have a control that allows embeddable editors, so for example I can set a property of controlsEmbeddableEditor =me.TextBox1 on my form, no problem here - what I want to do is the same thing...
3
by: Adriano | last post by:
Hello, when I try to print something, either DataGrid or from Crystal Report viever the folowing error message appears and cancels printing: Object reference not set to an instance of an...
4
by: nate axtell | last post by:
I'm looking for a way to refernce a control by a string that represents the name of the control. I dynamically create some textboxes, labels, and comboboxes each name by a loop iteration index. ...
7
by: mef526 | last post by:
I would like to reference a dynamically created control and I know the name. I would like to use the following: Dim strName as String = "txtControl1" ' This is the ".Name" used when textbox was...
14
by: 97T | last post by:
Well this is still bugging me. I know there are other ways around this, but for a number of reasons I would like to be able to do this one simple thing. I have a form with a number of controls...
3
by: SAL | last post by:
I am getting the following ERROR in my WebApp on line 30: Server Error in '/TestWebApp' Application. -------------------------------------------------------------------------------- Object...
9
by: =?Utf-8?B?VG9tbXkgTG9uZw==?= | last post by:
I don't know if the following is what you are looking for, but to me what you described was using a control array. If you were using vb6 that would be easy, the following articles hopefully...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.