Disable 'Print' in file menu and toolbar...

  • Thread starter Thread starter KHV
  • Start date Start date
KHV,
Right click the menu, and select Customize. Drag the File/Print
selection from the file menu onto the customize dialog box to delete it from
the menu. Do the same for the print icon on your menu bar.
hth
Al Camp
 
KHV said:
How can I disable 'Print' in the file menu and on the toolbar ?


Application.CommandBars("Menu
Bar").Controls("Window").CommandBar.Controls("Cascade").Enabled
= False

Application.CommandBars("Form
View").Controls("Print").Enabled = False
 
Sorry, I should have explained a little better what I want to do...
I need information on how to disable/enable the 'Print' selection by code. I
want the disable the Print option while viewing forms and enable the Print
option while viewing reports...
 
KHV said:
Sorry, I should have explained a little better what I want to do...
I need information on how to disable/enable the 'Print' selection by code. I
want the disable the Print option while viewing forms and enable the Print
option while viewing reports...

The easiest way to do this is to create separate toolbar/menubars for reports
and forms and display the appropriate ones for each object. On the "Other" tab
of the property sheet for forms and reports you can specify which menu and
toolbar should be displayed when that object has focus.

Ordinarily you are going to want other menu and toolbar items between forms and
reports anyway. For example, on forms you will likely want filter and sorting
options while on reports you might want zoom and "save-as" options.
 
Thank's for your reply,
I tried your code in the Form_Current function, but for both code lines I
get: Run-time Error '5': Invalid procedure call or argument

Any Idea ?
 
Thank's Rick,
Your suggestion works better than I had expected.... I may end up using your
method in this application....
I am though still interesting in finding out how to do this by code. Hope I
can get the code from Marshall to work...
 
Sorry, terribly sloppy with my Copy Paste and grabbed the
wrong line.

That error usually means that the bar or control name is
wrong, but even though I posted the wrong line, it should
not have caused an error.

Here's the one I meant to copy:

Application.CommandBars("Menu
Bar").Controls("File").CommandBar.Controls("Print...")

all on one line of course.
 
Thank's - Works Great !

Marshall Barton said:
Sorry, terribly sloppy with my Copy Paste and grabbed the
wrong line.

That error usually means that the bar or control name is
wrong, but even though I posted the wrong line, it should
not have caused an error.

Here's the one I meant to copy:

Application.CommandBars("Menu
Bar").Controls("File").CommandBar.Controls("Print...")

all on one line of course.
--
Marsh
MVP [MS Access]


I tried your code in the Form_Current function, but for both code lines I
get: Run-time Error '5': Invalid procedure call or argument
 
Back
Top