Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Custom Menu Bar (Commandbar) Help

Status
Not open for further replies.

zerocul

Programmer
Sep 9, 2002
18
US
I have created a custom menu bar named TIMETRACKER that replaces the standard Access MENU BAR when my application is started. The custom menu bar has 10 available pulldown menus on it such as "File", "Edit", "View" and so forth. Under the "File" pulldown menu I have such submenu items listed as "Login", "Logout", "Open", "Close" and so on.

When my application starts I immediately present the user with a login dialog box prompting the user for his/her password (username is already in the box via API call). What I want to achieve is to disable (gray out) the "Login" submenu item listed under the "File" pulldown menu. I have figured out how to disable/enable the top level of the menu bar via the following code:

set cbr=commandbars("Timetracker").Controls(1)
cbr.enabled=false

How to I step this down to the next level so that I can access individual submenu items and enable/disable those items. Any help would be greatly appreciated. Thanks in advance...
 
You need to extend your object:
commandbars("Timetracker").Controls("File").controls("Login").enabled=false

HTH

Ben ----------------------------------------
Ben O'Hara
Home: bpo@SickOfSpam.RobotParade.co.uk
Work: bo104@SickOfSpam.westyorkshire.pnn.police.uk
(in case you've not worked it out get rid of Sick Of Spam to mail me!)
Web: ----------------------------------------
 
Ben,

Thanks for the help, got me headed in the right direction. I was able to take your advice and us it in a For...Next statement to cycle through my commandbar and submenu commands. Thanks again...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top