Setting a default size of FORM

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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.
 
Dear Brendan
Many thanks for the code, it works perfectly.
Cheers
Chas & Happy New Year to you.
 
Back
Top