What command button code will cause this procedure to run.
Posted on 2000-03-02
What command button code will cause this procedure to run. Specifically, I don't understand what the "subject" parameter means.
Public Sub RunReport(Subject As String, Optional Preview As Variant)
Dim Access As Object
If IsMissing(Preview) Then Preview = False
Set Access = CreateObject("Access.Application")
If Preview Then 'preview report on screen
.Visible = True
.DoCmd.OpenReport Subject, acPreview
Else 'print report to printer
.DoCmd.OpenReport Subject, acNormal
DoEvents 'allow report to be sent to printer
Set Access = Nothing