Custom Menu Print Problems

P

Penstar

I have a database with a custom menu, contianing page setup, print preiew and
print buttons.

When we open a report in print preview mode, and press the print button it
goes straight to the printer. It doesn't give us the option to select pages
or printer to print to. This also happens when I go to for example a form.

When I go to print from the standard menu print button, it comes up with the
options I require.

How can I change this setting?

Thanks
Penny
 
A

Arvin Meyer [MVP]

Change the code from:

DoCmd.OpenReport "ReportNameHere"

to:

DoCmd.OpenReport "ReportNameHere", acViewPreview
 
A

Albert D. Kallal

Hum, it is possbile for your custom menu you took the wrong button.

I use the following:

Function DisplayPrintDialog()

On Error Resume Next
DoCmd.SelectObject acReport, Screen.ActiveReport.Name
DoCmd.RunCommand acCmdPrint

End Function

Place the above code in a standard code module, and then place a NEW buttion
on your custom menu bar that calls the above code by setting the on-action
name to the aobve function

eg:

=DisplayPrintDialog()
 
P

Penstar

Thank you for your suggestion and prompt response. I have ended up doing the
following (from a post on forums.techguy.org) which has fixed the issue:

I created a custom Menu bar. Placed the 'Print' command on the custom Menu
Bar. Set the properties of the 'Print' command like so....

Caption: &Print...
ScreenTip: &Print...
OnAction: mcrPrint
Style: Default Style

I then created a new module 'modPrint'

Code:
Public Function PrintDialogBox()

On Error GoTo HandleError

DoCmd.RunCommand acCmdPrint

HandleExit:
Exit Function

HandleError:
Select Case Err.Number
Case 2501 'in case of cancel
Resume Next
Case Else
MsgBox Err.Number & ": " & Err.Description
End Select
Resume HandleExit
End Function
Then I created a Macro (mcrPrint) to call the function in the modPrint module.

Penny
 

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