Resize - Screen resolution (1 Viewer)

Gismo

Registered User.
Local time
Today, 18:44
Joined
Jun 12, 2017
Messages
1,085
Hi all,

I want to resize the main form which have subform
I used the code ResizeForm Me
I have my form set to neither scroll bars

Firstly, even though i have set scroll bars to neither, the form has both scroll bars visible on one of my monitors
On the laptop screen there is no scroll bars
On my larger monitor there are no scroll bars
Secondly, the control on the main form has more than doubled in size, same result on all 3 my monitors

Please could you advise
 

isladogs

CID VIP
Local time
Today, 16:44
Joined
Jan 14, 2017
Messages
16,240
It sounds like you are using my automatic form resizing code.
However its difficult to answer as I'm finding your description unclear.

Is the form or subform or both showing scrollbars?
Have you removed scrollbars from the subform as well?
Are you using the zoom feature with zoom set at over 100%? Doing that does switch on scrollbars deliberately.
If that is the case then you can disable that line of code if you wish.

Does the base resolution in the code match your 'design resolution' used for your forms?

If its something else then you'll need to give us more information
 

Gismo

Registered User.
Local time
Today, 18:44
Joined
Jun 12, 2017
Messages
1,085
It sounds like you are using my automatic form resizing code.
However its difficult to answer as I'm finding your description unclear.

Is the form or subform or both showing scrollbars?
Have you removed scrollbars from the subform as well?
Are you using the zoom feature with zoom set at over 100%? Doing that does switch on scrollbars deliberately.
If that is the case then you can disable that line of code if you wish.

Does the base resolution in the code match your 'design resolution' used for your forms?

If its something else then you'll need to give us more information
Yes, I am using the modResizeForm module

I have disabled both main form and subform scroll bars, set to neither

I am working on my laptop with 2 different size monitors

When viewed, the scroll bars are visible and the form is scrolled over to the right

The controls on the main form is overly zoomed in although I do not use any zoom function

I had a quick look at your code, I dont see any resolution specified and recon it is picked up from the GetVerticalResolution and GetHorizonalResolution module
 
Last edited:

isladogs

CID VIP
Local time
Today, 16:44
Joined
Jan 14, 2017
Messages
16,240
Sounds like the form has become 'oversized' in design view and then saved at that size.
Please read Possible Issues and Solutions on page 2 of my online tutorial. It tells you how to fix that.
 

Gismo

Registered User.
Local time
Today, 18:44
Joined
Jun 12, 2017
Messages
1,085
Sounds like the form has become 'oversized' in design view and then saved at that size.
Please read Possible Issues and Solutions on page 2 of my online tutorial. It tells you how to fix that.
I actually already have that page open and looked at the issues an solutions

I added the below as you suggested
If CurrentDb.Properties("UseMDIMode") = 0 Then
MaximizeNavigationPane
DoEvents
MinimizeNavigationPane
End If

I have the ModNavPaneTaskbar mod downloaded but still get a sub or function not defined on MaximizeNavigationPane
 

isladogs

CID VIP
Local time
Today, 16:44
Joined
Jan 14, 2017
Messages
16,240
Hi
That section of code is already part of modResizeForm and has nothing to do with your issue.
Read further down that section for how to "unresize" the form i.e. restore its original size

The MaximizeNavigationPane function was missing from an earlier version of the code but its in all recent versions
Here it is along with MinimizeNavigationPane - both should be in modNavPaneTaskbar

Code:
Public Function MinimizeNavigationPane()

On Error GoTo ErrHandler

    DoCmd.NavigateTo "acNavigationCategoryObjectType"
    DoCmd.Minimize
        
Exit_ErrHandler:
    Exit Function
    
ErrHandler:
    MsgBox "Error " & Err.Number & " in MinimizeNavigationPane routine : " & Err.Description, vbOKOnly + vbCritical
    Resume Exit_ErrHandler

End Function

Public Function MaximizeNavigationPane()

On Error GoTo ErrHandler

    DoCmd.NavigateTo "acNavigationCategoryObjectType"
    DoCmd.Maximize
        
Exit_ErrHandler:
    Exit Function
    
ErrHandler:
    MsgBox "Error " & Err.Number & " in MaximizeNavigationPane routine : " & Err.Description, vbOKOnly + vbCritical
    Resume Exit_ErrHandler

End Function
 

Gismo

Registered User.
Local time
Today, 18:44
Joined
Jun 12, 2017
Messages
1,085
Hi
That section of code is already part of modResizeForm and has nothing to do with your issue.
Read further down that section for how to "unresize" the form i.e. restore its original size

The MaximizeNavigationPane function was missing from an earlier version of the code but its in all recent versions
Here it is along with MinimizeNavigationPane - both should be in modNavPaneTaskbar

Code:
Public Function MinimizeNavigationPane()

On Error GoTo ErrHandler

    DoCmd.NavigateTo "acNavigationCategoryObjectType"
    DoCmd.Minimize
       
Exit_ErrHandler:
    Exit Function
   
ErrHandler:
    MsgBox "Error " & Err.Number & " in MinimizeNavigationPane routine : " & Err.Description, vbOKOnly + vbCritical
    Resume Exit_ErrHandler

End Function

Public Function MaximizeNavigationPane()

On Error GoTo ErrHandler

    DoCmd.NavigateTo "acNavigationCategoryObjectType"
    DoCmd.Maximize
       
Exit_ErrHandler:
    Exit Function
   
ErrHandler:
    MsgBox "Error " & Err.Number & " in MaximizeNavigationPane routine : " & Err.Description, vbOKOnly + vbCritical
    Resume Exit_ErrHandler

End Function
Ah, excellent, Thank you
Main form works well

just struggling to get the subform to resize

Private Sub Form_Load()
DoCmd.Maximize
Application.Echo False
'auto resize form
ReSizeForm Me

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

End Sub
 

isladogs

CID VIP
Local time
Today, 16:44
Joined
Jan 14, 2017
Messages
16,240
Remove the UseMDIMode code block from your form. It isn’t meant to be used in a form and I have no idea what effect it would have.
 

Gismo

Registered User.
Local time
Today, 18:44
Joined
Jun 12, 2017
Messages
1,085
Remove the UseMDIMode code block from your form. It isn’t meant to be used in a form and I have no idea what effect it would have.
If i remove the UseDIMode from the subform, the form jumps to the right hand
I did the unresize as you advised
It seems to work when I remove UseDiMode ftom the main form

Resize seems to work well on the main form
The sub form does not resize to full screen

1645506751333.png


1645506939501.png
 
Last edited:

isladogs

CID VIP
Local time
Today, 16:44
Joined
Jan 14, 2017
Messages
16,240
I don't know how much clearer I can say this:
The UseMDIMode code block is part of the ResizeForm procedure in modResizeForm.
That is the ONLY place it should be used.
Remove that code from ALL forms you have added it to.

Then 'unresize' the subform separately either using the FixFormSize procedure or using form frmFormUnresizer
 

Gismo

Registered User.
Local time
Today, 18:44
Joined
Jun 12, 2017
Messages
1,085
I don't know how much clearer I can say this:
The UseMDIMode code block is part of the ResizeForm procedure in modResizeForm.
That is the ONLY place it should be used.
Remove that code from ALL forms you have added it to.

Then 'unresize' the subform separately either using the FixFormSize procedure or using form frmFormUnresizer
Yes I have removed it from my code

For some reason, my main form goes back to over sizing every time it opens after it has been shrunk by using the frmFormUnresize
 

isladogs

CID VIP
Local time
Today, 16:44
Joined
Jan 14, 2017
Messages
16,240
In that case, it sounds like you either have an issue with the size of the main form in design view or the value for the DESIGN_HORZRES constant is incorrect for the size of the form you are using

Strongly recommend you read the entire article again carefully to make sure you understand what each of the above points mean.
Then make a backup (just in case) and tweak your settings accordingly.
 

Gismo

Registered User.
Local time
Today, 18:44
Joined
Jun 12, 2017
Messages
1,085
Hi,

I am revisiting the form resize issue again
My main form seems to resize well after a few adjustments, shrink and enlarge
When I move the DB between my 3 different size monitors, resize is cooperation

My issue is when the DB opens, my main menu is enlarged, the moment I move to another monitor the resolution is corrected
 

isladogs

CID VIP
Local time
Today, 16:44
Joined
Jan 14, 2017
Messages
16,240
Hi,

I am revisiting the form resize issue again
My main form seems to resize well after a few adjustments, shrink and enlarge
When I move the DB between my 3 different size monitors, resize is cooperation

My issue is when the DB opens, my main menu is enlarged, the moment I move to another monitor the resolution is corrected

For some reason, my main form goes back to over sizing every time it opens after it has been shrunk by using the frmFormUnresize

As mentioned originally its always best to build AFR into a database when it is created rather than add it later on.

See my previous reply in post #12 as its impossible for me to know what is causing that issue in your database.
As previously suggested, you may need to modify the dimensions of your main form in design view or edit the DESIGN_HORZRES constant value in modResizeForm

If neither of those are appropriate for your purposes, then consider either 'unresizing' the main form on form close or disabling AFR completely for the main form

Good luck
 

Gismo

Registered User.
Local time
Today, 18:44
Joined
Jun 12, 2017
Messages
1,085
As mentioned originally its always best to build AFR into a database when it is created rather than add it later on.

See my previous reply in post #12 as its impossible for me to know what is causing that issue in your database.
As previously suggested, you may need to modify the dimensions of your main form in design view or edit the DESIGN_HORZRES constant value in modResizeForm

If neither of those are appropriate for your purposes, then consider either 'unresizing' the main form on form close or disabling AFR completely for the main form

Good luck
Hi,

Just to clarify
My main form has two sub forms
The second sub form has four sub forms

I only resize on the main form and the second sub form

Both main form and second sub form has been redesigned with modified dimensions

The resizing seems to work well when switching between different size monitors
For now, my issue is when the DB opens the resizing is incorrect but when I switch monitors it corrects itself

Also the main form seem to be oversized in the buttons every time I switch between design view and form view
Is it possible to exclude resizing on certain controls?
 

isladogs

CID VIP
Local time
Today, 16:44
Joined
Jan 14, 2017
Messages
16,240
For now, my issue is when the DB opens the resizing is incorrect but when I switch monitors it corrects itself
Its almost certainly a design issue with the dimensions of the form(s) used.
I did have one non-maximised continuous form which caused me problems for a long time until I modified its dimensions in design view
Look at my supplied template form shapes & sizes.

Both main form and second sub form has been redesigned with modified dimensions
But not the other forms you listed ....?

Also the main form seem to be oversized in the buttons every time I switch between design view and form view
Is it possible to exclude resizing on certain controls?
This may be due to having option groups or tab controls close to the bottom right of the form(s)
See the Possible Issues & Solutions section on page 2 of my tutorial web articles:

If using a split form, ensure you disable the splitter bar as using that will cause the form to save the 'resized' version resulting it in being over-enlarged' on close.

If you know switching views is an issue in this case, then avoid it. Close the form & re-open in design view

You could in theory modify the code to exclude certain controls.
e.g. assign a tag value EXCL to those you don't want to resize and add code to only resize controls where ctrl.Tag<>"EXCL"

However doing that will be messy both to code and likely to lead to an aesthetically unpleasant looking form.
Far better to fix the root cause rather than try & do a botched fix to the AFR process
 
Last edited:

Users who are viewing this thread

Top Bottom