We have different sized monitors here and I noticed when opening the database the form doesn't fit properly on one of them. Is there a way to auto fit one of the forms for that monitor?
Bill contacted me by PM.
This is the reply I've just sent to him:
I've undone most of the security but as its a split database and I only have the FE, I can't test the following suggestion.
Import modResizeForm from the example app in my resizing tutorial.
In the declarations section at the top of the module, find these two lines:
Private Const DESIGN_HORZRES As Long = 800
Private Const DESIGN_VERTRES As Long = 600
Change those to the resolution you designed in:
Private Const DESIGN_HORZRES As Long = 1920
Private Const DESIGN_VERTRES As Long = 1080
Now add the line ResizeForm Me to the Form_Load event of the forms you want to resize.
On your PC, the forms will remain the original size.
On a lower resolution, HOPEFULLY they will scale down correctly.
I've not tried scaling down for years so have no idea how well it will work ...if at all.
As you are using tabbed documents, I'm not going to place a bet on it working
If that does work, let me know.
If not, then it looks like you will need to redesign based on the lower resolution.
For info, my designs are based on 800*600 but I use the same resolution as you.
However I use overlapping windows for display purposes.
The design resolution means that form sizes are made so they would fill the screen if using that resolution (800*600 in my case) but would be smaller (before resizing) at higher resolutions
I didn't look at your new FE but relinked the BE you uploaded to the FE I tested earlier
I made a few changes:
a) Added modNavPaneTaskbar from my example app. Needed as you are using tabbed documents
b) After some experimentation, I modified the declarations in modResizeForm to:
Private Const DESIGN_HORZRES As Long = 1440
Private Const DESIGN_VERTRES As Long = 900
Not sure why but that seems a good compromise
c) Added 2 code lines to the Form_Load event of each of the 5 forms you mentioned MainForm, AFRs1 to AFRs4
Code:
DoCmd.Maximize 'not really needed for tabbed documents as always maximised
ResizeForm Me
I tested the code in 3 resolutions (1920*1080; 1680*1050 & 1440*900) on 2 different monitors of similar sizes. I haven't been able to try it on my 10 inch tablet as its completely flat at the moment.
On the 2 monitors I did test, resizing now seems to work well but you may need to slightly adjust the form width in design view to get it perfect on your own monitors.
I noticed that some labels don't fully display as the control width is slightly too small...but that is nothing to do with the resizing code
2 versions of the FE attached
1. AFR System 21.7 -TD.accdb (tabbed documents display)
2. AFR System 21.7 -OW.accdb (overlapping windows display)
I prefer the latter but its up to you. Of course with the OW version you would need to add buttons to close forms and navigate to other forms
NOTE: You will need to relink to your own BE - not bothered uploading that here as I made no changes to it. Check that I've restored all your security
Hope that helps and that you can do any further minor adjustments to the form dimensions yourself
BTW - is there any real point password protecting your forms if the passwords used are so obvious?
No problem.
Hopefully its near enough what you need to avoid redesigning the forms.
Two golden rules for the future if you need to cater for users with different Access versions or resolutions.
1. Always design in the earliest version of Access that any of your users are running. It should still work in later versions but not vice versa.
For that reason, I still develop in A2010
2. If using automatic form resizing, design your forms so they fit and look right in the lowest resolution in use and set the constants in the resize module accordingly. It will scale up correctly in higher resolutions.