Maximizing preview window for report...

J

Jason M Canady

I am using the following VB to open a report but cannot seem to get the
preview window to open maximized. Am I missing something? Can someone
please point me in the right direction?

Thanks, Jason

Private Sub Command0_Click()
On Error GoTo Err_Command0_Click

Dim stDocName As String

stDocName = "Equipment Report-Location"
DoCmd.OpenReport stDocName, acPreview
DoCmd.RunCommand acCmdZoom100
Exit_Command0_Click:
Exit Sub

Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click

End Sub
 
G

Gary Miller

Instead of this line...

DoCmd.RunCommand acCmdZoom100

try

DoCmd.Maximize


--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
 
J

Jeff Boyce

Jason

Another possibility would be to embed the DoCmd.Maximize in the report's
OnOpen event.

Good luck

Jeff Boyce
<Access MVP>
 
J

Jason M Canady

Gary,
Thanks. I ended up using both lines to get the result that I wanted. I am
just learning all this access VB stuff and find it a bit maddening when
learning by myself!. Thanks again!

Jason
 
J

Jason M Canady

Jeff, thanks for the input. Your suggestion works quite well. Now I must
decide which route to impliment in my db. I guess the deciding factor would
be wether or not I would want to preview the report NOT maximized at some
point...

Thanks again,
Jason
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top