Link to home
Start Free TrialLog in
Avatar of esauseesau
esauseesau

asked on

Access 2007 opens in print preview rather than report view

I'm having an issue with no matter what I do, my report keeps opening in print preview and I want it to open in report view.   I'm using Access 2007 on XPSP3.

This is what I have done:
In the property sheet I've set - Default View = Report View, All Report View = Yes

I created the following event:

Private Sub Report_Open(Cancel As Integer)
DoCmd.OpenReport "Report_SCS Database Query", acViewReport
End Sub


I'm not an Access guru, any help would be appreciated.
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

use a command button in a form to open the report in preview

private sub btnPreview_click()
DoCmd.OpenReport "Report_SCS Database Query", acViewPreview

end sub
Avatar of esauseesau
esauseesau

ASKER

I don't want it to open in print preview, I want it to open in report view.
oh, sorry...

try , from the Navigation pane double-click the report to open it in Report view

ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
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
your code:

Private Sub Report_Open(Cancel As Integer)
DoCmd.OpenReport "Report_SCS Database Query", acViewReport
End Sub

Implies that you are using the Open event of one report to Open another report.  Is that really what you want to do?

I'm still trying to figure out what the difference between acViewReport and acViewPreview is.  Only difference I see is that acViewReport does not have the same ribbon as acViewPreview
"your code:

Private Sub Report_Open(Cancel As Integer)
DoCmd.OpenReport "Report_SCS Database Query", acViewReport
End Sub

Implies that you are using the Open event of one report to Open another report.  Is that really what you want to do?

I'm still trying to figure out what the difference between acViewReport and acViewPreview is.  Only difference I see is that acViewReport does not have the same ribbon as acViewPreview"


No after open the report and enter the parameter to query, it opens in print preview and I would like it to open in report view.   All of the above I've done was just from information I've obtained through Google and tried not really knowing what I was doing or why.
as i posted open the report from a commnd button  in a form

see http:#a33735159 

also, what is this  "enter the parameter to query"  what parameter is this?

you can pass this parameter using codes ...

private sub btnReportView_click()

' you can enter the parameter here and pass it as a Where clause before opening the report

DoCmd.OpenReport "Report_SCS Database Query", acViewReport

end sub
and , delete the codes that you have on the open event of the report.
When you run the query in brings up an input box where the user enters a last name to query.  That's what I meant by parameter.
is the query the record source of the report?

post the SQL statement of the query..  or better upload a copy of your db.