views:

31

answers:

1

Hi all, I have a report in Access 2007 that is opened by pressing a button on a form. This button triggers an OpenReport macro, where the report is told to open in Print Preview view, and Dialog window mode.

How can I manually set the size of this window, along with the opening zoom level?

In the properties of the report, both AutoResize and FitToPage have been set to No. However, I have tried other combinations and had no luck.

Any help is much appreciated.

A: 

You could always set the windows position and size in the OnOpen event. Use the SetWindowPos function to do this. You can find out how to use it here.

I don't think there is a way to set the zoom level.

CodeSlave
Thanks for your reply but I think what you have proposed is for the main access window, rather than for just the report dialog window. I'm looking for something along the lines of InsideWidth and InsideHeight (as can be used for forms).
Newbie
In the past, Access has not allowed programmatic resizing of a report window so far as I know. The only choice was to set it onscreen and hit Ctrl-S to save, and hope that was retained. If the default printer changes, most of the saved report settings are lost, for instance.
David-W-Fenton
Thanks for your reply. I'm afraid I can't try your Ctrl+S method since the window is in Dialog mode (so I can't manually resize it upon opening!)...and I can't change this mode by manually setting the Modal and Pop Up values since this brings additional problems regarding focusing on the report window. I'm happy to settle with what I have, I'm just rather baffled by the way the default window size occasionally changed randomly during the report's development (hence why I assumed it could be programmatically resized).
Newbie
You can do it in design view. That is, open in design view in the UI, switch to preview, position and size it, then Ctrl-S. When you then open it as dialog, it should retain the same sizing and positioning as when you hit Ctrl-S.
David-W-Fenton