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.
KapriceAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Access 2010 includes the concept of "anchoring", which can be used to resize controls. I'd think you'd want to select the "Stretch Down and Across" setting. These can be found on the Arrange - Anchoring ribbon item.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PatHartmanCommented:
Put this code into the main form's Resize event:
    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.
0
KapriceAuthor Commented:
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)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.