Size to Fit Form programmatically?

A

Angela

Is there a way to implement "size to fit form" programmatically? I have one
form that is sometimes opened without the form header visible. When that
happens, I need to resize the form to it doesn't look goofy.
 
M

mtn244

Docmd.movesize might solve the problem. It doesn't automatically
size-to-fit, but you can use it to always open a form to a specific size.

The following instructions were posted by fredg on 9/29/2006:

Look up the MoveSize method in VBA help.
Code it's Open event:

DoCmd.MoveSize L*1440, T*1440, W*1440, H*1440

Where W is the Width of the form (in inches) and H is the height of
the form (in inches).

L and T are the left and top position of the fom on the screen.

All measurements, however, are in Twips (1440 per inch), so that is
why the measurements are multiplied by 1440.
 
M

Marshall Barton

Angela said:
Is there a way to implement "size to fit form" programmatically? I have one
form that is sometimes opened without the form header visible. When that
happens, I need to resize the form to it doesn't look goofy.


Have you tried setting the form's AutoResize to Yes? If you
did, what about it doesn't do what you want?

Are you sure the form, header and all, will fit in the
Access window?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top