ResizeForm Me - An Automatic Form Resizing Tutorial (1 Viewer)

Status
Not open for further replies.

isladogs

MVP / VIP
Local time
Today, 16:38
Joined
Jan 14, 2017
Messages
18,186
See attached for a detailed article in PDF format about automatic form resizing based on the free open source code by Jamie Czernik.

Having used this code for over 15 years, I have written the article as it appears many people do not know how to use the feature effectively with their own applications

The first part of the article discusses the benefits of automatic form resizing when developing applications for use with different monitor sizes and resolutions.
It also briefly covers an alternative approach based on layout guides and anchoring.

The second part explains how the automatic resizing code works and provides tips for using the code most effectively in your own applications.
It also covers some potential issues you may experience and possible solutions for each of these.

The attached files are
a) The article in PDF format (ResizeForm Me PDF.zip)
b) 3 example applications referenced in the article (ResizeFormExamples.zip)
c) The original resizing code by Jamie Czernik from 2003 (afr.zip)

An extended version of the PDF is also available on my website:
ResizeForm Me - An Automatic Form Resizing Tutorial

I hope this is useful to other Access developers.
Any questions or comments, please send me a PM or email
 

Attachments

  • afr.zip
    143.4 KB · Views: 1,081
  • ResizeForm Me PDF.zip
    1.9 MB · Views: 1,265
  • ResizeFormExamples.zip
    318.2 KB · Views: 1,316

theDBguy

I’m here to help
Staff member
Local time
Today, 09:38
Joined
Oct 29, 2018
Messages
21,358
You know, I've seen many discussions about this topic but it never interest me before because I haven't had a need to use it. Hopefully, your instructions would be simple enough to follow that I could try them out. Thanks!
 

isladogs

MVP / VIP
Local time
Today, 16:38
Joined
Jan 14, 2017
Messages
18,186
An issue with font sizes has been reported by CJ_London. See post #2 in this thread: Optimising Queries - Speed Tests

As a result, I've made a minor change to the Resize procedure used in this code.

If you have also experienced the same issue, please use the updated version attached

NOTE: Over the coming weeks, I will gradually update the resizing code which is included in most of my other example apps
 

Attachments

  • ResizeFormExample v2.2.zip
    314.3 KB · Views: 762

isladogs

MVP / VIP
Local time
Today, 16:38
Joined
Jan 14, 2017
Messages
18,186
Unlike Word & Excel, there is no built in zoom control available in Access.
For those with less than perfect eyesight this can be an issue.

I have now added an extra form to the example app to show how Access forms can be zoomed using a modified version of the resizing code. The new code allows further adjustment of the form between 75% to 125% of the default size for your screen & resolution



Use the combo or (ActiveX) slider control to adjust the scale in 5% intervals according to personal preference.
The form dimensions and all controls SHOULD be adjusted accordingly
For example, with zoom = 125%



The zoom can be reset to normal by clicking the 100% button

NOTE:
1. Increasing the zoom may cause part of the form to move ‘off screen’ as in the screenshot above. Scrollbars appear automatically when this happens
2. Currently, the slider is an ActiveX control. This will be hidden and ‘inactive’ if you have disabled ActiveX controls in Access Options Trust Center. I will replace it with a non ActiveX control in the future
3. The zoom code has also been successfully tested with popup forms with zoom level from 50% - 150%
4. This demo app is intended for use with the overlapping windows option. Using the tabbed documents option can cause problems with forms being shifted off screen to the top left

As this is a moderated area, please send me a PM or email me with any feedback on the Zoom feature or any other aspect of this code

UPDATE
OOPS - reference issue for users with 64-bit Access in Windows 10
Version 2.4 in post #6 fixes this
 

Attachments

  • ResizeFormExample v2.3 + Zoom.zip
    301.1 KB · Views: 710
  • AFR30.jpg
    AFR30.jpg
    78.6 KB · Views: 3,601
  • AFR31.jpg
    AFR31.jpg
    91.4 KB · Views: 3,420
Last edited:

deletedT

Guest
Local time
Today, 16:38
Joined
Feb 2, 2019
Messages
1,218
This is from version 2.3



 

Attachments

  • 2019-03-13_16-08-16.jpg
    2019-03-13_16-08-16.jpg
    35.1 KB · Views: 2,570
  • 2019-03-13_16-07-48.jpg
    2019-03-13_16-07-48.jpg
    78.1 KB · Views: 2,520

isladogs

MVP / VIP
Local time
Today, 16:38
Joined
Jan 14, 2017
Messages
18,186
OOPS - The common controls references shouldn't be there and can be removed.

I added them temporarily to help answer a question about these not being available in 64-bit Access ... and then forgot to remove them!

However another standard reference needs to be restored: Microsoft Office xx.0 Access database engine object library (ACEDAO.dll)



Version 2.4 attached with references fixed
 

Attachments

  • ResizeFormExample v2.4 + Zoom.zip
    291.6 KB · Views: 626
  • Refs.PNG
    Refs.PNG
    12.4 KB · Views: 2,931

isladogs

MVP / VIP
Local time
Today, 16:38
Joined
Jan 14, 2017
Messages
18,186
Further update to version 2.5
This fixes a major issue using form resizing code with tabbed document display option
Until now, this option caused forms to be shifted down & to the right

As I never use the tabbed documents option, it never worried me enough to fix it.
However the fix is ridiculously simple and has now been added to the ResizeForm procedure in modResizeForm

The UseMDIMode property is 1 for overlapping windows and 0 for tabbed documents
After resizing, the code fix maximizes then minimizes the navigation pane if tabbed documents are in use

Code:
  If CurrentDb.Properties("UseMDIMode") = 0 Then
        MaximizeNavigationPane
        DoEvents
        MinimizeNavigationPane
    End If

Doing this is sufficient to reset the form positioning correctly.
It has been tested successfully with document tabs both visible / hidden.
No fix is required for overlapping windows

Version 2.5 also includes a simple popup form with adjustable zoom from 50% to 150% of default size. Hopefully someone will find a use for that!

New example app & PDF help file attached
 

Attachments

  • ResizeFormExample v2.5 + Zoom.zip
    315.5 KB · Views: 796
  • ResizeForm Me PDF v2.5.zip
    1.8 MB · Views: 866
Last edited:

deletedT

Guest
Local time
Today, 16:38
Joined
Feb 2, 2019
Messages
1,218
Let me thank you for all the time and effort you put on these articles and sharing your knowledge and experience.
Just one question if you don't mind.

I've noticed almost all of your databases use this Resize function, before you posted this article here. It was very interesting and I took my time to go through the code and the structure and design of the forms.

One thing that remained a puzzle to me and I couldn't understand was How do you design your forms? Obviously as you explained in your site, Stretching is much easier than shrinking. When I open one of your forms in design view, the form, controls, and text is so tiny that designing and moving around is not that simple.
How do you add/move the controls when you're in design mode?
 

isladogs

MVP / VIP
Local time
Today, 16:38
Joined
Jan 14, 2017
Messages
18,186
Hi
Thanks for your feedback

I use a 22 inch monitor with a resolution of 1680X1050.
The 'default' form size I use is based on the 800x600 example template and a Calibri 7pt font size.

This is mainly due to historical reasons - I've been using the code since 2005 when monitors were smaller & resolutions much lower. It was important to always use a base resolution as low as the lowest used by my clients

Bear in mind that I'm no longer young and need to wear glasses at all times.
However, I find that still works for me. In any case, it would be too disruptive to go back & 'upsize' several thousand older forms now

However, if I was starting up now, I would probably base my forms on a base resolution of 1280x960 and font size= 9/10pt.

For info, I've now posted an updated version of my website article with additional information, tips & hints.
See http://www.mendipdatasystems.co.uk/automatic-form-resizing-1/4594554784
I will further update the PDF to match that article in the next day or two
 
Last edited:

isladogs

MVP / VIP
Local time
Today, 16:38
Joined
Jan 14, 2017
Messages
18,186
As mentioned in my last reply, I've done a further (and hopefully final) update to version 2.6.
This is now available from my website: http://www.mendipdatasystems.co.uk/automatic-form-resizing-1/4594554784

Main changes:
a) Minor bug fixes in error handling in modResizeForm
b) Additional tips / hints and further explanation of the code in both the PDF & web article.
Unfortunately the PDF is now more than 2MB after zipping so I'm unable to upload it here

As previously mentioned the code now works with both overlapping windows and tabbed documents
 

coypu

Registered User.
Local time
Today, 16:38
Joined
Mar 12, 2019
Messages
26
Hi Colin
I think your new support for tabbed document display, needs modNavPaneTaskbar to be imported, as well as modResizeForm.
Many thanks for a finely crafted solution for those of us finding the font sizes we used 20 years ago, now way too small.
I'm using this in the new charity application that's underway, so if there's silence on this, assume all is good, and much appreciated.
All the best
Coypu
 

isladogs

MVP / VIP
Local time
Today, 16:38
Joined
Jan 14, 2017
Messages
18,186
Good point. Or the function code can be used instead. Either way, thanks for mentioning it.
 

isladogs

MVP / VIP
Local time
Today, 16:38
Joined
Jan 14, 2017
Messages
18,186
Attached is the latest version (3.4) of the Automatic Form Resizing (AFR) example application.

Previously I described variousadditional features including support for tabbed documents display and form zoom.

Since this thread was last updated in 2019, there have been many further changes to include support for:
  • split forms
  • navigation forms
  • datasheets
A couple of months ago, I was asked to run a session on the use of AFR for the US based Lunchtime Access User Group led by Maria Barnes.
There were major issues with internet delays during the session. However, I'd like to pass on my gratitude to the hard work of Crystal Long for editing the video so professionally that you would never know there had been any problems!

The video of the session was uploaded to You Tube on 1 Nov and is proving very successful having already received over 700 views in less than 2 weeks. Click the link below to view the video


I hope this will encourage more people to make use of this very useful feature

As this is a locked thread, please send me a PM or start a new thread if you have any comments or questions
 

Attachments

  • ResizeFormExample v3.4.zip
    933.5 KB · Views: 649
Status
Not open for further replies.

Users who are viewing this thread

Top Bottom