Hi, I have created a custom menu bar for my application at design-time. At runtime I successfully disable controls and sub-menu items on the menu bar based on what the user can do on a particulare form or report. The following code works for menu bar items and sub-menus:
CommandBars("PT DocToolMenuBar").Controls("Print").CommandBar.Controls("Close").Enabled = True
I have also created a toolbar (short-cut), the name is "ToolBar - Appointments", at design time. The user accesses the toolbar with a right-click on a specific form. I want to disable items on the toolbar based on what the user is attempting to do. I have the following coded in a MouseDown event:
CommandBars("ToolBar - Appointments").Controls("Block Time").Enabled = False
I receive the following runtime error "Invalid Procedure call or Argument", err.number = 5.
Can anyone tell me what I am doing wrong?
Thanks,
Bill
CommandBars("PT DocToolMenuBar").Controls("Print").CommandBar.Controls("Close").Enabled = True
I have also created a toolbar (short-cut), the name is "ToolBar - Appointments", at design time. The user accesses the toolbar with a right-click on a specific form. I want to disable items on the toolbar based on what the user is attempting to do. I have the following coded in a MouseDown event:
CommandBars("ToolBar - Appointments").Controls("Block Time").Enabled = False
I receive the following runtime error "Invalid Procedure call or Argument", err.number = 5.
Can anyone tell me what I am doing wrong?
Thanks,
Bill