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.

Thanks!!!
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 12 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 12 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros