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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Manipulating a button of a menu bar

Status
Not open for further replies.

zevw

MIS
Jul 3, 2001
697
US
I understand that I can disable a button on a menubar with the following code:
Code:
CommandBars("MenuName").Controls("Print").Enabled = False

Or to hide
Code:
CommandBars("MenuName").Controls("Print").Visible = False

However I want to manipulate the Print button and see what is being printed a form or a report. Where would I write the code for the print button and say print only reports not forms?

Thanks for your help in advance!
 

I am not sure if you can do that with a build in command bar, you can if it is custom command bar control. When you add a command bar control you can then associate an "onaction" property. This tells you what code to run when the control is selected. I have never tried it with a built in bar/control. But build a simple procedure to test it, then see if you can assign that procedure to the onaction property. See the link it shows this with adding a control.
 
I created a custom Toolabar and use it as the default menu Bar (I'm not sure if this is the same as a command bar?) I"m trying to find the On Action property and can't find it. Can you please guide me where I can find it?

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top