?
Solved

Calling Control property using Variable

Posted on 2003-03-31
7
Medium Priority
?
154 Views
Last Modified: 2010-04-07
Is it possible to call control properties using variable.

Say, I have a Menu control. Name is "New".
I declared on variable ("strControl") and assigning the value "New" to that string variable.
Now i am using ...> strControl.enabled=false .
It is not working for me. Is there a way i can achive these kind of requirement.
Please help me in this.
0
Comment
Question by:VijayK
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 3

Expert Comment

by:cmgarnett
ID: 8237835
Select Case strControl
Case "New"
   mnuNew.Enabled = False
Case "Old"
  mnuOld.Enabled = False
End Select
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 8237854
Hi VijayK,

Open questions:
03/31/03 http:Q_20568661.html "Calling Control property using Variable"
03/17/03 http:Q_20553244.html "Passing Parameter value to ActiveXViewer"
03/06/03 http:Q_20541932.html "DataBase connection with Crystal Reports"
03/06/03 http:Q_20540607.html "ORA-12638 : Credential retrieval failed"
01/16/03 http:Q_20460241.html "Impact on compiling prodecure without table."
01/13/03 http:Q_20455117.html "ActiveX control stops IIS"
12/18/02 http:Q_20430621.html "How to send parameter to Crystal Reports"
12/13/02 http:Q_20425304.html "How window.screenTop   differs from mach..."
12/03/02 http:Q_20414229.html "Restricting multiple user login with same loginId"

Please close your open questions. Failure to maintain your questions is in contravention to the user agreement and you may be penalised or have your account suspended if you fail to do so.

Tim Cottee MCSD, MCDBA, CPIM
http://www.timcottee.tk 

Brainbench MVP for Visual Basic
http://www.brainbench.com

Experts-Exchange Advisory Board Member
0
 

Author Comment

by:VijayK
ID: 8237875
Hi,

   See i have around 60 menus. I don't want to hard code in my code and don't want to loop so many times.
Menu name comes from DataBase with ID. I am going to Loop thru the Recordset and enabling/disabling the menu.
Is it possible??

Thanks.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 4

Expert Comment

by:iozturk
ID: 8237954
There is no other way to do it:) Just enable and disable them.
0
 
LVL 43

Accepted Solution

by:
TimCottee earned 500 total points
ID: 8237997
It is possible:

Use

CallByName Me.Controls(strControl),"Enabled",True,vbLet
0
 

Author Comment

by:VijayK
ID: 8238041
Hi TimCottee..

Thanks a lot. Excelent.

0
 
LVL 43

Expert Comment

by:TimCottee
ID: 8238069
VijayK

Thanks for also cleaning up your outstanding questions.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question