Get rid of Design View from print preview shortcut menu

H

h2fcell

OK here’s a tricky one in Access 2007.
I have a report that opens using the below code.

Private Sub Command13_Click()
Dim myFilter As String

myFilter = "[Network] = [Forms]![frmNWDialog_for_rptNet3_3]![cboNetwork]" _
& " And [DepartureDate] Between
[Forms]![frmNWDialog_for_rptNet3_3]![tboFromDate] And
[Forms]![frmNWDialog_for_rptNet3_3]![tboToDate]"

DoCmd.OpenReport "rptNet3_3_Summary_By_Date", acViewPreview, , myFilter,
acWindowNormal

End Sub

I have set the following properties:
“Allow Report View†= No
“Allow Layout View†= No

When I right click on the report print preview, the following shortcut menu
appears.

Design View
Print Preview
Zoom: 100%
One Page
Multiple Pages
Page Setup…
Print…
Save As…
Export
Send To
Close

I need all the options except Design View.

Is there a way via code to get rid of Design View from that menu?
Please help.
Thanks.
 
H

h2fcell

****************
Dale,

commandbars("Print Preview Popup").Controls(3).visible = false
Worked for me.
You are beyond brilliant.

****************





Dale_Fye via AccessMonster.com said:
Try:

commandbars("Print Preview Popup").Controls(3).visible = false
OR
commandbars("Print Preview Popup").Controls(3).enabled = false

Don't forget to enable or unhide this control when you close the report.


To get this, I typed the following into my immediate window, and hit enter.

For intLoop = 1 to commandbars.count : debug.print commandbars(intLoop).name :
Next

This gave me a list of all of the commandbars. I then reviewed the names of
the commandbars and found "Print Preview Popup"

I then typed the following into my immediate window, and hit enter

For each ctrl in commandbars("Print Preview Popup").controls : debug.print
ctrl.index, ctrl.Caption : Next

which gave me:

1 &Report View
2 La&yout View
3 &Design View
4 Print Pre&view
5 &Zoom:
6 &One Page
7 &Multiple Pages
8 Page Set&up...
9 &Print...
10 Save &As...
11 &Export
12 Sen&d To
13 &Close

HTH
Dale

OK here’s a tricky one in Access 2007.
I have a report that opens using the below code.

Private Sub Command13_Click()
Dim myFilter As String

myFilter = "[Network] = [Forms]![frmNWDialog_for_rptNet3_3]![cboNetwork]" _
& " And [DepartureDate] Between
[Forms]![frmNWDialog_for_rptNet3_3]![tboFromDate] And
[Forms]![frmNWDialog_for_rptNet3_3]![tboToDate]"

DoCmd.OpenReport "rptNet3_3_Summary_By_Date", acViewPreview, , myFilter,
acWindowNormal

End Sub

I have set the following properties:
“Allow Report View†= No
“Allow Layout View†= No

When I right click on the report print preview, the following shortcut menu
appears.

Design View
Print Preview
Zoom: 100%
One Page
Multiple Pages
Page Setup…
Print…
Save As…
Export
Send To
Close

I need all the options except Design View.

Is there a way via code to get rid of Design View from that menu?
Please help.
Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top