Link to home
Start Free TrialLog in
Avatar of tols12
tols12

asked on

How do i open a MS Access 2007 report not in Print Preview?

I just closed a question on how to create a button on a form to print a singe record. That is working perfectly now by printing a report. However, when i click that button, it opens the report in print preview. I added a button to the report that will print it, but becasue the report is opened in print preview, i can't click the button. how do i change the report to open not in print preview so i can click on the print button? here's the coding i am using on the form to open the report:

Private Sub Command286_Click()
   Dim strReportName As String
   Dim strCriteria As String
   
   strReportName = "Contact"
   strCriteria = "[ID]=" & Me![ID]
   DoCmd.OpenReport strReportName, acViewPreview, , strCriteria
End Sub
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Do you mean

 DoCmd.OpenReport strReportName,acViewNormal acViewPreview, , strCriteria

?
ASKER CERTIFIED SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tols12
tols12

ASKER

Schweet! That did it. Thanks!!!