Restore window size on close

DarkProdigy

Registered User.
Local time
Today, 13:56
Joined
Jan 9, 2006
Messages
91
Hey guys,

I figured out to maximize a window when a report is opened, but now I want to restore the window sizes when this report is closed.

I think I kind of know what to do with the DoCmd.Restore and something about OnClose, but I'm lost in the syntax. If someone could help me out by giving me the syntax and where to put this code that would be fantastic :)
 
In the forms OnOpen event you could use the docmd.restore command.

I prefer to force the exact size of my forms using this in the forms OnOpen event...

Private Sub Form_Open(Cancel As Integer)
On Error GoTo Err_Form_Open

'just for testing
MsgBox "InsideHeight = " & InsideHeight & vbCrLf & vbLf & "InsideWidth = " & InsideWidth

InsideHeight = 5450 'twips is the unit of measurement
InsideWidth = 7870

Exit_Form_Open:
Exit Sub

Err_Form_Open:
MsgBox Err.Number & " - " & Err.Description
Resume Exit_Form_Open

End Sub
 
thanks for the help ghudson, got it working beautifully
 

Users who are viewing this thread

Back
Top Bottom