473,396 Members | 1,997 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,396 software developers and data experts.

How to disable (dim) a menu item

I want to dim (disable) a specific menu item dropped down from a toolbar
menu item. I looked for a property I could change but no luck. Access 97.
Suggestions?
Nov 12 '05 #1
3 7836
In a form, add this code for a button (on the form)

Private Sub Command5_Click()
Dim ctl As CommandBarControl
Set ctl = CommandBars("Menu Bar").Controls("&Tools")
ctl.Enabled = False
End Sub

I don't know which item you want to disable but you have to precede it
with &. To get a list of all the items on the menu bar you can use this
code:

Private Sub Command5_Click()
Dim CB As CommandBar, ctl As CommandBarControl
Set CB = CommandBars("Menu Bar")
For Each ctl In CB.controls
Debug.Print ctl.Caption
Next
End Sub
Rich

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #2
Thanks, that's a start. This works fine for a menu item on the bar proper,
but what about an item which is dropped down from one of those items?
Nov 12 '05 #3
I managed to solve it. Thanks anyway...

Dick
Nov 12 '05 #4

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

Similar topics

5
by: Brian Henry | last post by:
I have a form with a main menu on it (mdi parent form) and i have a child form with a menu and I am mergeing the menus together for the menu called reports.. now when i do this they merge just...
6
by: Agnes | last post by:
In my menu, there is invoice,customer .... etc As the user click 'Invoice' , the invoice form is load, then I want to disable the "Invoice" menu in the Menuitem, ,so the user can only new one...
7
by: Wayne | last post by:
I have found the following code on this newsgroup that removes the Access Application minimize, restore and close buttons. Private Const GWL_EXSTYLE = (-20) Private Const GWL_STYLE = (-16) ...
5
by: Ike | last post by:
Does anyone know how to disable a list box element in VB 6 ? Thanks Ike
0
by: Nick 'The Database Guy' | last post by:
Hi Guys, When my database opens it run the following code. Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long Private Declare Function...
8
by: Nemo | last post by:
Hello Guys, Can somebody tell me how I can disable a menu item such as "save as" in the Internet Explorer or Netscape using Javascript. Thanks. Nemo
1
by: John Devlon | last post by:
Hi, Can someone please help me. I've got a strang problem in Visual Studio 2005 I've created a windows application, using an MDI form and top menu. When a menu item is clicked, a new instance...
1
by: =?Utf-8?B?QW5kcmV3?= | last post by:
Hi, friends, I am using C#.net 2005 to create a windows application. It has menu items, such as File, etc. Under File, there are more menu items, such as New Files, Working Files, etc. Under...
56
by: Deepan HTML | last post by:
Hi All, Currently i am working in a framed environment where i have divided the window as 20% and 80% and the 20% is used for navigation purpose and right frame for displaying the orignal content....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.