Preventing a form from printing

gbradley

New Member
Joined
Aug 27, 2002
Messages
23
In Access97 can you prevent a form from printing?
Disable Ctrl-P
Thank-you for any feedback
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Hi,

To disable ctrl + P, make sure the Form's KeyPreview set to Yes, and, using the code builder, paste this in the Form's On Key Down event:
Code:
If Shift And acCtrlMask Then
    If KeyCode = vbKeyP Then
        KeyCode = 0
    End If
End If
HTH,stubby
 
Upvote 0
Thanks that worked great. :biggrin:
Now I just have to prevent the immediate print button on the toolbar
rtg_print.gif
 
Upvote 0
Hi,

If it is suitable for your database, why not create your own toolbar that only has what you want on it? If so, you could then select your new toolbar in the 'all' or 'other' properties of your form.

You would also have to uncheck the 'allow full menus' & 'allow built-in toolbars' in Tools/Startup (you will have to shift-open the database to get the full menus for designing afterwards, though).

HTH, stubby
 
Upvote 0
Thank-You I think that is what I'd like to do.
Here's the thing....
The guys are supposed to hit a command button on the Form.
This Command button opens up a Report in Print Preview.
Then they hit the Print button on the toolbar
rtg_print.gif


I don't know how to put a command button work in print preview.
I'll keep working on it.

Wait I think I get it....
I guess I can create another Macro that prints the Report only.
I'll put a command button on my custom toolbar that runs this Macro.
Thanks for your help.
 
Upvote 0

Forum statistics

Threads
1,221,851
Messages
6,162,429
Members
451,765
Latest member
craigvan888

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top