PercyN
Programmer
- May 16, 2007
- 86
Hi, I have a custom menu bar called "MyMenu" which has some drop down menus like "Customers", "Vendors" etc. Under each of these drop down menus, I have a number of controls
For instance under "Customers" I have "New Customer", "New Invoice" etc.
I used the following code
Dim mb As CommandBar
For Each mb in Application.CommandBars
If mb.Name = "MyMenu" Then
mb.Controls("Customers").Enabled = False
End if
Next mb
But what I actually want to do is not disable "Customers" and everything under it but rather to diabale "New Customer" which is a child of "Customers" and leave the other children active. But when I try to refer to the children it does not work.
For instance under "Customers" I have "New Customer", "New Invoice" etc.
I used the following code
Dim mb As CommandBar
For Each mb in Application.CommandBars
If mb.Name = "MyMenu" Then
mb.Controls("Customers").Enabled = False
End if
Next mb
But what I actually want to do is not disable "Customers" and everything under it but rather to diabale "New Customer" which is a child of "Customers" and leave the other children active. But when I try to refer to the children it does not work.