Maximizing preview window for report...

  • Thread starter Thread starter Jason M Canady
  • Start date Start date
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
 
Instead of this line...

DoCmd.RunCommand acCmdZoom100

try

DoCmd.Maximize


--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
 
Jason

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

Good luck

Jeff Boyce
<Access MVP>
 
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
 
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
 
Back
Top