Setting a default size of FORM

C

Chas Large

Hi,
I have seen this done but can't remeber where, I need to set the default
size for a form. Each time I open design view and resize the blue border the
form takes on that shape when I re-open it after saving.

I have found me.width and put this into the form open sub but it does not
appear to work, what am I doing wrong?

Private Sub Form_Open(Cancel As Integer)
Me.Width = 20
End Sub

I have Modal and Popup set to YES for the form.

Cheers

Chas
 
B

Brendan Reynolds

Private Sub Form_Open(Cancel As Integer)

Me.Detail.Height = 1440 * 3
Me.Width = 1440 * 3
DoCmd.SelectObject acForm, Me.Name
DoCmd.RunCommand acCmdSizeToFitForm

End Sub

The unit of measurement is "twips", and there are 1440 twips to an inch, so
the above example produces a form which is about 3 inches square.
 
C

Chas Large

Dear Brendan
Many thanks for the code, it works perfectly.
Cheers
Chas & Happy New Year to you.
 

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