0
votes

I have a button on a form that should open a report but it sending the report to the default printer instead. How do stop it from printing? I'm using access 2010

Private Sub Generate_Click()
    If Me.Staff = "<< All >>" Then
        DoCmd.OpenReport "rptAll", acViewNormal, , , acHidden
    Else
        DoCmd.OpenReport "rptStaff", acViewNormal, , , acHidden
    End If
End Sub
1
Use acViewLayout, acViewReport or acViewPreview. But why are you hiding it?Andy G

1 Answers

1
votes

You should use acViewReport as stated here in the MSDN doc if you want to show the report.

http://msdn.microsoft.com/en-us/library/office/ff195735%28v=office.15%29.aspx