• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 335
  • Last Modified:

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
0
tols12
Asked:
tols12
  • 3
1 Solution
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Do you mean

 DoCmd.OpenReport strReportName,acViewNormal acViewPreview, , strCriteria

?
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
ooops... cut and paste error

DoCmd.OpenReport strReportName,acViewNormal , , strCriteria
0
 
tols12Author Commented:
Schweet! That did it. Thanks!!!
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
You are welcome ...

mx
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now