Senin, 25 Februari 2013

[MS_AccessPros] Run-time error '2451' (Report Name you entered is mispelled)

 

In the following code I am getting err 2451 in
line (Set rpt = Reports!strReport)

The following procedure is called by:

PrinterDuplex(strReport)
Where strReport="rptOnlW9DplxEngSpanLtr"

'----------------------------------------------------------
Public Sub PrinterDuplex(strReport)
On Error GoTo PrinterDuplex_Error
Dim rpt As Report

DoCmd.OpenReport strReport, acViewPreview, , , acHidden

Set rpt = Reports!strReport

With rpt.Printer
.Copies = 2
.Duplex = acPRDPVertical 'Double sided
.PaperBin = acPRBNLargeCapacity
End With

DoCmd.OpenReport strReport, acViewNormal
DoCmd.PrintOut , , , acHigh, 1
DoCmd.Close acReport, strReport, acSaveNo
Set Application.Printer = Nothing

On Error GoTo 0
Exit Sub
PrinterDuplex_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure PrinterDuplex of Module ModPublic"
End Sub
'----------------------------------------------------------

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar