howto? Resize form to hide controls on left side

Rx_

Nothing In Moderation
Local time
, 18:49
Joined
Oct 22, 2009
Messages
2,803
Access 2010 when a control is put on the left-hand side of a form, the form can not be resized to hide that control.

Format is Single Form, Auto Resize - NO, Fit to Screen - NO, No scroll bars,

See attachment for concept.
Whe the form's width is narrowed, it pops back (resizes) to show the controls on the left. It doesn't seem to work with a Me.width = AValue
either.

I remember demonstrating this way back in Access 97 or Access 2. Or maybe that was using VB.
Any ideas on how to dynamically change the width to leave the controls not showing?

Found this answer on another forum:
It is possible to hide controls by setting their Visible property to False, or to modify the form's width by altering its Width property accordingly.
One thing that cannot in Access is to set the width of the form less that the objects on it ... even if those objects are not visible.

My comment:
This answer is also my experience in Access 2010.
One solution might be to hide all the controls, then use code to move them all to the center of a form, and code to move them back to the left when the form is widened.
Well, I was just trying to be lazy. Will just leave the space there and dynamically show/hide the controls on a form with the same width.
If anyone has a method to do this, be sure and let us know.
 

Attachments

  • Access 2010 Form Dynamic Size.gif
    Access 2010 Form Dynamic Size.gif
    8.9 KB · Views: 263
Last edited:
Hello Rx,
it is very easy and simple you don't need to write that much code.
it is all about Me.InsideWidth = YourNumber * 1440
I have already made a sample form and attached it here it shows you how to hide controls and show it again while changing the width exactly as you want, I hope this is useful.
Regards.
Khodr.
 

Attachments

Users who are viewing this thread

Back
Top Bottom