This tip will divulge Twips Secrets Sizing Forms Reports
This tip is suitable for all versions of Microsoft Access, but see the light blue help boxes , for extra bits of info if you are using Microsoft Access 2007 or Microsoft Access 2010.
I do not know about you, but I have had considerable grief on setting the size of forms and reports. The windows seem to open up to whatever size they like. I usually get around this by Maximizing them, but there is another solution which is infinitely more flexible.
In this lesson we will cover Macros that will set the size of the form and report windows.
We will cover:
• Maximizing the form;
• The MoveSize action;
• And finally, TWIPs, just in case you want to know what they are.
Maximizing a Form or Report
To maximize a form or report:
You can now add this macro to the ‘On Open’ event or one of the other related events for any form or report you wish to Maximize on opening.
The MoveSize Action
Maximizing a form or report might not give you the result you want, this is where the ‘MoveSize’ action comes in handy.
To set the ‘MoveSize’ action in a Macro:
Unlike the ‘Maximize’ action you also have to select criteria as to where you wish the window to be positioned and what size you would like it.
So, at the bottom of the window set the four criteria:
You can now add this macro to the ‘On Open’ event or any other appropriate event for any form or report you wish to set the size of the window on opening.
The ‘MoveSize’ action may need to be built and individualized for each individual form/report, if you want them to be different sizes. Keep this in mind when you are naming the Macro. In this case it maybe better if you are using Access 2007/10 to leave it as an embedded Macro.
Twips/SetValue
A form’s height and width can also be set using the 'SetValue' action of a macro.
This is handy to know if you wish to change the size of a form from another form. The ‘MoveSize’ action can only be used for the current form or report. To do this:
Follow the steps above, but choose ‘SetValue’ from the drop down list of the Macro.
Help Box Trusted Locations If you add what Microsoft Access 2007 or 2010 classifies as an unsafe Macro such as 'SetValue' then you will need to add your database path to 'Trusted Locations', to learn how to do that, then Click Here You will also need to 'Show All Actions', if you need some help with this then Click Here. |
Then:
Please Note: The InsideWidth and InsideHeight properties are only available for forms and not reports.
Finished with Twips Secrets Sizing Forms Reports then Return to Microsoft Access Forms
or