Layout view of Report from Form command

  • Thread starter Thread starter OMS
  • Start date Start date
O

OMS

Hi,

I would like to display the Layout Preview of a report from the On_Click
event on my form. I know acViewNormal, acViewPreview and acViewDesign but
Preview still runs the query in the report (some of which takes several
minutes).

Is there a code to take it from Design View to Layout Preview I could use?
Or a way to go straight to Layout Preview?

Thanks,
 
I've decided to use this but am getting dropdown from Access with Alt+F4 on
it as you would get if you right click the titlebar.

DoCmd.OpenReport "strDocName" acViewDesign
SendKeys "% (V) Y"

Any ideas?
 
That makes a mighty big difference.

There is no "Layout" view or "Layout Preview" in Access 2003; just Print
Preview or Design View. You have to use acViewPreview or acViewDesign.

--
Jeff Conrad - Access Junkie - MVP Alumni
SDET - XAS Services - Microsoft Corporation

Co-author - Microsoft Office Access 2007 Inside Out
Presenter - Microsoft Access 2007 Essentials
http://www.accessmvp.com/JConrad/accessjunkie.html
Access 2007 Info: http://www.AccessJunkie.com
 
Yes, I realize that. Thay's why I was using SendKeys as per my second post:

I've decided to use the code below but am getting dropdown menu from Access
with Alt+F4 on
it the same as you would get if you right click the titlebar with the report
open in design view (it does open in design view by the way).

DoCmd.OpenReport "strDocName" acViewDesign
SendKeys "% (V) Y"

Sorry for the confussion.
 
Ahhhh I see what you're doing now.

Sorry, I'm still stuck in 2007 mode.
:-)

I would steer away from SendKeys if possible.
Try this instead:

DoCmd.OpenReport "strDocName" acViewDesign
DoCmd.RunCommand acCmdLayoutPreview

--
Jeff Conrad - Access Junkie - MVP Alumni
SDET - XAS Services - Microsoft Corporation

Co-author - Microsoft Office Access 2007 Inside Out
Presenter - Microsoft Access 2007 Essentials
http://www.accessmvp.com/JConrad/accessjunkie.html
Access 2007 Info: http://www.AccessJunkie.com
 
Very cool. Now that's the answer to my question I was looking for. I didn't
really want to use SendKeys either but I'm pretty new and knew where I
wanted to go but didn't know the right avenue to take.

Thank you very much for hanging in there with me.

Sean
 
Back
Top