Print A Form

B

Bob Barnes

Looking for code to print a Form...w/ options to select 17" paper,
landscape, etc.

This works to a limited degree...

Dim M$, N$, Resp%
On Error GoTo AAA1
N = "Are You Sure You Want To" & vbCrLf
N = N & "Print This Form?"
Resp = MsgBox(N, vbQuestion + vbYesNo + 256, "Print This Form?")
If Resp = vbYes Then
Screen.MousePointer = 11
DoCmd.SelectObject acForm, "MainMenu", True
DoCmd.PrintOut , 1, 1
DoCmd.SelectObject acForm, "MainMenu", False
End If
AAA2:
Screen.MousePointer = 1: Exit Sub
AAA1:
Select Case Err
Case 2212
MsgBox "Cannot Print Now.": Resume AAA2
Case 2501
MsgBox "Print Has Been Cancelled.": Resume AAA2
Case Else
MsgBox "Error " & Err.Number & " " & Err.Description: Resume AAA2
End Select

TIA - Bob
 

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