hncwalker
asked on
CommandBars - how to disable using VBA for different forms
I am looking for a way to disable my custom CommandBar on all forms except when I want it to appear, which is a datasheet view inside a form. Any help would be greatly appreciated!!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you so much!
This worked beautifully. When I closed the datasheet view of the form, I had to add this code to the open form event so that the toolbar would not show when I went back to the original form:
'------------------------- ---------- --
' lets try to disable the commandbar
'------------------------- ---------- --
CommandBars("new menu").Visible = False
You are awesome!
This worked beautifully. When I closed the datasheet view of the form, I had to add this code to the open form event so that the toolbar would not show when I went back to the original form:
'-------------------------
' lets try to disable the commandbar
'-------------------------
CommandBars("new menu").Visible = False
You are awesome!
If your datasheet is a subform, try doing this...
In your Got_Focus event of your subform control, put in:
DoCmd.ShowToolbar "NameOfCommandBar", acToolbarYes
In the Lost_Focus event:
DoCmd.ShowToolbar "NameOfCommandBar", acToolbarNo
Hope this helps.