OpenReport in Preview ????

  • Thread starter Thread starter Pete Beatty
  • Start date Start date
P

Pete Beatty

Is there a way to maximize the preview window when using the OpenReport
"Rpt", acpreview command?

The current window does not have Minimize or Maximize buttons and the user
would like to expand the preview window. Maybe there is a way to force the
Minimize and maximize buttons to be active.
 
Pete said:
Is there a way to maximize the preview window when using the OpenReport
"Rpt", acpreview command?

The current window does not have Minimize or Maximize buttons and the user
would like to expand the preview window. Maybe there is a way to force the
Minimize and maximize buttons to be active.


You can use:
DoCmd.Maximize
immediately after the OpenReport line.

If your forms do not have the Min/Max buttons, you don't
even have to worry about restoring the window before closing
the report. However, I normally use:
DoCmd.Restore
in the report's Close event just in case I have a form that
can be maximized.
 
Thanks for the reply.

I tried your suggestion and it did not change the results.
 
Pete said:
Thanks for the reply.

I tried your suggestion and it did not change the results.

Try putting DoCmd.Maximize in the Report's Open event and DoCmd.Restore in its
Close event.
 
Maybe I misunderstood. If the report has its MinMaxButtons
property set to None, then there is no way to maximize the
report window. Why not enable those buttons?

The only way I can think of to achieve the desired effect
with those buttons disabled is to determine the Access
window dimensions and resize (using DoCmd.MoveSize) the
report to fill most of it. I'm pretty sure this would
require one or more API calls, but I can't help you with
that. Try googling for more info.
 
Marshall,
the MinMaxButton property is set to Both Enabled. However, the buttons are
not displayed.

Marshall Barton said:
Maybe I misunderstood. If the report has its MinMaxButtons
property set to None, then there is no way to maximize the
report window. Why not enable those buttons?

The only way I can think of to achieve the desired effect
with those buttons disabled is to determine the Access
window dimensions and resize (using DoCmd.MoveSize) the
report to fill most of it. I'm pretty sure this would
require one or more API calls, but I can't help you with
that. Try googling for more info.
--
Marsh
MVP [MS Access]



Pete said:
I tried your suggestion and it did not change the results.
 
How did you do that? I've never heard of a way (aside from
APIs) to hide the Min/Max buttons without setting the
property to None. Even then, DoCmd.Maximize seems to work
for a previewed report.

Are you sure your code looks like:

DoCmd.OpenReport "reportname", acViewPreview
DoCmd.Maximize

I guess, what I'm saying is that I'm at a loss to explain
what you're seeing.
 
Back
Top