Scaling Down Form (1 Viewer)

billgyrotech

Banned
Local time
Today, 02:43
Joined
Apr 18, 2013
Messages
258
Hello,


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?


Thanks,
Bill
 

billgyrotech

Banned
Local time
Today, 02:43
Joined
Apr 18, 2013
Messages
258
Thank you NauticalGent this is very extensive and might be beyond my capabilities but I will try.
 

NauticalGent

Ignore List Poster Boy
Local time
Today, 03:43
Joined
Apr 27, 2015
Messages
6,286
Roll up the sleeves and get into it. If you get stuck, you know what to do...
 

billgyrotech

Banned
Local time
Today, 02:43
Joined
Apr 18, 2013
Messages
258
Okay I gave it a try and it was really messed up with giant fields that were on top of each other.


Thanks anyway
 
Last edited:

isladogs

MVP / VIP
Local time
Today, 07:43
Joined
Jan 14, 2017
Messages
18,186
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

Good luck
 

billgyrotech

Banned
Local time
Today, 02:43
Joined
Apr 18, 2013
Messages
258
Thanks Colin is there an attachment? If not I will try to follow your edits.
 

billgyrotech

Banned
Local time
Today, 02:43
Joined
Apr 18, 2013
Messages
258
I adjusted the code and now when opening a form on my monitor the form is very small so I guess it does affect it.


Thanks for trying. Maybe the small monitor will crap out and another one that is the larger size will replace it.
 

isladogs

MVP / VIP
Local time
Today, 07:43
Joined
Jan 14, 2017
Messages
18,186
From what you told me, it should have had no effect on your own monitor.

If you can upload the BE so I can test the code I may be able to tweak the code further.
Dummy data will be fine as long as I can open the forms.

Even if that monitor can be got rid of, issues with different screen resolutions won't go away
 

billgyrotech

Banned
Local time
Today, 02:43
Joined
Apr 18, 2013
Messages
258
Colin,


I commented out the one line for Event Load but the code is there under Module 1.


Here are the Front and Back Ends. No need for dummy data there isn't anything that is so critical.


Thanks very much for your help,
Bill
 
Last edited:

isladogs

MVP / VIP
Local time
Today, 07:43
Joined
Jan 14, 2017
Messages
18,186
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?
 

Attachments

  • AFR System 21.7 -TD.zip
    1.2 MB · Views: 66
  • AFR System 21.7 -OW.zip
    1.2 MB · Views: 63
Last edited:

billgyrotech

Banned
Local time
Today, 02:43
Joined
Apr 18, 2013
Messages
258
Thank you very much Colin for your extensive efforts. I will try them out when I get to work in a few hours.



I set the passwords easy at first for trials and plan to change them later.


Nobody here will intentionally cause any harm to the data but they aren't the most computer literate is why there needs to be protection.
 

isladogs

MVP / VIP
Local time
Today, 07:43
Joined
Jan 14, 2017
Messages
18,186
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.
 

Users who are viewing this thread

Top Bottom