Problem with AFR (Automatic Form Resizing) (1 Viewer)

Local time
Today, 02:02
Joined
Feb 28, 2023
Messages
628
This was taken from my 8-page thread that got too complicated:
Question for @isladogs

I was trying to get AFR working. My monitor resolution is 1920*1200. When I open form 800x600 in the AFR Database, it looks like this:
1691513635180.png


I created a new blank database and copied the 800x600 template form over to it. I also copied ALL of the modules from AFR over to it. Your page said the code only needed the one line in the form load event and the ModResizeForm module, but I got errors about missing functions when I open it that way.

When I open the 800x600 form in the new blank database, I see this:
1691513834481.png


I had display document tabs selected above, but it looks the same with them turned off:
1691514073861.png


The forms look the same in design view in either database.

What do I need to do/change?
 

isladogs

MVP / VIP
Local time
Today, 07:02
Joined
Jan 14, 2017
Messages
18,221
Glad to see you started a new thread for this.

Which version of my AFR example app are you using?
If its the latest version 3.94, you need to import several additional modules and two tables into your own app for it to work successfully.
See section 8 in part 4 of my AFR article (which is even longer than your original thread but should be read carefully in its entirety!)

Also, because you are designing your forms in 1920*1080, that's the template you should be using (or your own version of it).
Make sure you alter the two constants DESIGN_HORZRES and DESIGN_VERTRES in the imported module modResizeForm to match your 'base' resolution.

My preference is to use overlapping windows display with the forms maximized, but it should work fine using tabbed documents, with or without the tabs.
 
Local time
Today, 02:02
Joined
Feb 28, 2023
Messages
628
tblmonitors fixed it in the blank database.

I was using the 800x600 template b/c I figured if it made that look good at 1920x1080, it would work with most anything I could throw at it and at least I knew it was working.

Also - I see where I got tripped up on your page. I didn't read all four pages. Page 1 says I only needed one module and one line of code - which I guess was true for v 3.75. Then the downloads section of the page lists 3.94 first and doesn't mention looking at Page 4.

I haven't tested it with my working database yet, but I have a quick question on what the values should be:

Several years ago, we had a worker with 1650x900 (1600x900) resolution. The database was designed to work with that with some scrolling, but I haven't tested it at that resolution each time.

The database displays properly at 1920x1080 with no scrolling. I think most of our users use that, and I'm thinking that is what I should set the values at.

My external monitors are 1920x1200 and it works at that setting - I just have some unused space at the bottom of each form.

My laptop is 14" and 1920x1080 and I use a 125% scale factor and have to scroll the database slightly vertically.

I know one of our users uses a larger scale factor - maybe 150 or 175% and I'm not sure how it works for him, other than he probably has to scroll a lot.

Thank you again for your help and effort with this. It is very impressive code!
 

isladogs

MVP / VIP
Local time
Today, 07:02
Joined
Jan 14, 2017
Messages
18,221
I always recommend everyone to read ALL four pages of the article to ensure they understand all the implications and potential issues.
That's why the artiicles are so long. There's a lot of info to understand if you are going to use this feature

AFR works best when scaling up so I recommend designing for the lowest resolution of any of your users and setting the two constants accordingly.
If you slightly tweak the size of your template form it should cope with all variations such as those you've mentioned and any future changes to monitor size and resolution.

The code has been tested on monitors varying from 10" tablets to 42" widescreen and at resolutions up to 3840*2100. Also on various form factors including portrait monitors. Windows scaling should also be no issue as that just adjusts the resolution
 
Local time
Today, 02:02
Joined
Feb 28, 2023
Messages
628
Thanks - it is working with my main database, but I don't think it is going to work for us - at least for the laptop screen.

It seems to be scaling everything about 1/3 greater.

For example - at 1920x1080 with Windows Scaling at 125% and AFR off, I have to slightly scroll down to view all the fields of the database. With AFR on, it would be similar to if I set Windows Scaling at 175%. The fields are huge and the text is crystal clear, but I have to scroll vertically and horizontally to use the database.

At 1920x1080 with Windows scaling at 100% and AFR off, the entire form is visible without scaling, but the text is uncomfortably small to read and use. With AFR on, it is similar to what I see with Windows scaling at 125% - which is what I am used to, but other apps are too small on the laptop at 100%.

It is probably related to my form width and height, as I didn't design the forms with your templates - basically I set the forms to work at 1920x1080 with no scaling and went from there.

(The 1680x1050 Template also has to be scrolled in the downloaded file on the laptop.)
 

isladogs

MVP / VIP
Local time
Today, 07:02
Joined
Jan 14, 2017
Messages
18,221
Have you read all of my articles in full?
As the series of articles & videos make absolutely clear, applying AFR to existing forms is likely to cause problems.
The use of AFR should be planned from the start!

You didn't design the forms with my AFR code in mind so unsurprisingly the results aren't what you want!

Hopefully my example app works OK for you. The problems are probably when using AFR with your own forms or trying to use the templates where the two constants don't match the resolution for which each template was designed

The code does exactly what it is designed to do.
If you set DESIGN_HORZRES to e.g. 1680 and add AFR code to an existing form then view it with a resolution 1920*1080, the form size will be scaled up by about 14% as 1920/1680 = 1.14 approx

Its very unlikely that you will want to re-design your existing forms with AFR in mind.
So I recommend you only use it for new forms planned to work with AFR ... or only use it on new projects
 
Local time
Today, 02:02
Joined
Feb 28, 2023
Messages
628
@isladogs - I didn't mean any offense. The code is VERY impressive.

I skimmed all our your articles in full - which is NOT the same as reading them.:cool:

I'll try the example with the constants changed and see how it works.

I probably don't want to re-design the existing forms, but it would be nice if the entire form was visible and editable regardless of the resolution. That is the goal of AFR, but I'm not convinced it is fully possible. I'm not blaming AFR for that - If I have a laptop with a 13-inch screen and a 4K resolution (why???), I'm going to have to have the scaling to 300 or 400% to be viewable and AFR is going to hit the Access max form width and there isn't much that can be done about that.

Question - the largest template that was included seemed to be 1680x1050. If I wanted to use AFR and design for 1920x1080, there isn't a template to use. How would I do that?

Question2 - not trying to be argumentative, and maybe there is no reason to do it, but if FormA was designed to work at 800x600 and formB was designed to work at 1680x1050, how do I use AFR on both forms? There seems to be only one constant to set.
 

isladogs

MVP / VIP
Local time
Today, 07:02
Joined
Jan 14, 2017
Messages
18,221
Please READ all the articles in full. Ideally watch one or more of the videos as well.

AFR works extremely well provided all forms are designed with the same 'base resolution'.
With proper design, the entire forms will be visible no matter what resolution or screen size you have
It is unrealistic to expect it to work properly with the situation described in question 2

AFR does not affect whether a form is editable or otherwise

The templates meant to be used as guides.
I created them by trial & error in various resolutions. The dimensions may need adapting for your purposes

My main monitor is 1680*1050. I do have a secondary monitor & a 12" tablet that use 1920*1080 but decided to leave that resolution for end users to create for themselves if needed. You are just as capable as me at doing that!

For higher resolutions, I rely on a number of willing volunteers to test new features where necessary.
Also whatever scaling factor is used, AFR cannot scale up forms to be wider than the maximum allowed width of 22.75 inches approx.
So it scales up to that width and keeps all the control sizes and positions in proportion
 

Users who are viewing this thread

Top Bottom