I have this code:
Code:
Sub printReport()
Dim sDate As String
DoCmd.SetWarnings.False
sDate = Format(Date, "ddd")
If sDate = "Mon" Then
DoCmd.OpenReport "Rpt_Monday", acViewPreview
End If
If sDate = "Tue" Then
DoCmd.OpenReport "RPT_Tuesday", acViewPreview
End If
'here is where I try to print
Dim prt As Printer
Set prt = Application.Printer
Application.Printer = Application.Printers("Lexmark")
DoCmd.PrintOut
Set Application.Printer = prt
End Sub
However I get a compile error on the prt As Printer saying User-Definted type not defined
This is Access 2000, Win 7