P
Paul3rd
Hello,
I have a form "OTradeEvaluations" that opens with
the code:
Private Sub OpnNTrade_Click()
On Error GoTo Err_OpnNTrade_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "NTradeEvaluations"
'Open form at new, blank record (as FormAdd).
DoCmd.OpenForm stDocName, acNormal, , , acFormAdd
Exit_OpnNTrade_Click:
Exit Sub
Err_OpnNTrade_Click:
MsgBox Err.Description
Resume Exit_OpnNTrade_Click
End Sub
A Print button on the form has the following code:
Private Sub PBNTE_Click()
Dim stDocName As String
Dim MyForm As Form
stDocName = "NTradeEvaluations"
Set MyForm = Screen.ActiveForm
DoCmd.SelectObject acForm, "NTradeEvaluations", True
Forms("NTradeEvaluations").Printer.Orientation = acPRORLandscape
DoCmd.PrintOut acSelection, 1, 1, acMedium, 1, False
DoCmd.SelectObject acForm, "NTradeEvaluations", False
Exit_PBNTE_Click:
Exit Sub
End Sub
When the print button is pressed, I get a "Runtime Error 2501"
PrintOut was cancelled.
The debugger shows the problem to be in the line:
DoCmd.PrintOut acSelection,1,1 acMedium,1,False
Is there a way to print out this blank form?
Thanks in advance,
Paul
I have a form "OTradeEvaluations" that opens with
the code:
Private Sub OpnNTrade_Click()
On Error GoTo Err_OpnNTrade_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "NTradeEvaluations"
'Open form at new, blank record (as FormAdd).
DoCmd.OpenForm stDocName, acNormal, , , acFormAdd
Exit_OpnNTrade_Click:
Exit Sub
Err_OpnNTrade_Click:
MsgBox Err.Description
Resume Exit_OpnNTrade_Click
End Sub
A Print button on the form has the following code:
Private Sub PBNTE_Click()
Dim stDocName As String
Dim MyForm As Form
stDocName = "NTradeEvaluations"
Set MyForm = Screen.ActiveForm
DoCmd.SelectObject acForm, "NTradeEvaluations", True
Forms("NTradeEvaluations").Printer.Orientation = acPRORLandscape
DoCmd.PrintOut acSelection, 1, 1, acMedium, 1, False
DoCmd.SelectObject acForm, "NTradeEvaluations", False
Exit_PBNTE_Click:
Exit Sub
End Sub
When the print button is pressed, I get a "Runtime Error 2501"
PrintOut was cancelled.
The debugger shows the problem to be in the line:
DoCmd.PrintOut acSelection,1,1 acMedium,1,False
Is there a way to print out this blank form?
Thanks in advance,
Paul