Link to home
Start Free TrialLog in
Avatar of VijayK
VijayK

asked on

Calling Control property using Variable

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.
Avatar of cmgarnett
cmgarnett
Flag of United Kingdom of Great Britain and Northern Ireland image

Select Case strControl
Case "New"
   mnuNew.Enabled = False
Case "Old"
  mnuOld.Enabled = False
End Select
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
Avatar of VijayK
VijayK

ASKER

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.
There is no other way to do it:) Just enable and disable them.
ASKER CERTIFIED SOLUTION
Avatar of TimCottee
TimCottee
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of VijayK

ASKER

Hi TimCottee..

Thanks a lot. Excelent.

VijayK

Thanks for also cleaning up your outstanding questions.