troubleshooting Question

Positioning/resizing Subforms based on users Res

Avatar of Thirt
Thirt asked on
Microsoft Access
12 Comments1 Solution356 ViewsLast Modified:
I've been making progress with the help of the experts here to resize subforms. I have a main form (frmnewestimates) that gets maximized at load time, The subforms have been hard coded to their positions and are not maximizing with the main form. There are two subforms. The Tasks subform is on top of the Effort Sub form.
I have the following code working to widen the sub forms to the max:
    Me.sfrmTasks.Width = Me.InsideWidth
    Me.sfrmEffort.Width = Me.InsideWidth

Now I would like to dynamically assign the height to the sub forms so that the Tasks subform gets 40% of the space, and the Effort subform gets the remain space, which works out to about 32% of the total InsideHieigt of the main form, leaving the rest for the Main form header and footer.

I'm able to set the height of the Tasks subform only by using the following code in the sub form's ON LOAD event:
    Me.InsideHeight = Forms!frmnewestimates.InsideHeight * 0.4241
The problem I run into now is setting the Top position and height for the second subform (Effort) that goes directly under the first subform (Tasks). I've tried the following Main form ON LOAD event:
    Me.sfrmEffort.Top = Me.sfrmTasks.Top + Me.sfrmTasks.Height + 200
    Me.sfrmEffort.Height = Me.InsideHeight * 0.32
I've tried setting the Top and Height with hard coded numbers, but I just can't get it to budge that subform. Any ideas how to position that subform properly? I've tried to do it from the subform's ON LOAD, but there is no TOP value available to set.


Our community of experts have been thoroughly vetted for their expertise and industry experience.

Log in to continue reading
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform for $9.99/mo
View membership options
Unlock 1 Answer and 12 Comments.
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
The Value of Experts Exchange in My Daily IT Life

Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>


Owner of Outages.IO
Phoenix, Arizona, United States
Member Since 2016
Join a full scale community that combines the best parts of other tools into one platform.
Unlock 1 Answer and 12 Comments.
View membership options
“All of life is about relationships, and EE has made a virtual community a real community. It lifts everyone's boat.”
William Peck

Member since 2004