Kaprice
asked on
MS Access 2010 - Maximize subform on Main form resize
I'm looking for (hopefully simple) sample code to maximize a subform within the Detail section of a main form whenever the main form resizes.
Seems it should be simple, but it's eluding me.
Seems it should be simple, but it's eluding me.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That did the trick. I didn't know 2010 had added Anchoring. Thanks much!
(the other expert answer deserves kudos for pre-2010 versions. Thanks both)
(the other expert answer deserves kudos for pre-2010 versions. Thanks both)
Const LeftRightPadding = (0.125 + 0.25) * 1440
Const TopBottomPadding = (0.65 + 0.375) * 1440
Me.sfrmClient.Height = Me.InsideHeight - TopBottomPadding
Me.sfrmClient.Width = Me.InsideWidth - LeftRightPadding
You'll need to change the subform references and play with the numbers in the constants. The top and bottom padding are the most difficult to adjust. The distance from the top of the main form plus the size of the header will impact the numbers.