Sizing my form to fit

GaelicFatboy

Registered User.
Local time
Today, 20:33
Joined
Apr 17, 2007
Messages
100
I'm have considereable problems trying to get a form I've designed to remember the size I configure.

I'm looking for a popup form to auto centre and I want to set its width and height for how it would appear when it is first opened, but each time I size the form and close it the configured size is lost and the original size, which is too big for the screen, takes over.

I'm using 2007

I've set the auto centre, auto resize and fit to screen to every combination, but nothing works. Is there another way to fix the hieght and width of my form for when it is first opened?

Any advice would be appriciated.

D
 
Ensure you do NOT have Documents Windows Option set to Tabbed Documents.

This is the code I use in the forms OnOpen event to force the size of the forms I want.

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

    'MsgBox "InsideHeight = " & InsideHeight & vbCrLf & vbLf & "InsideWidth = " & InsideWidth
    InsideHeight = 3400
    InsideWidth = 6000
 
Cheers for the advice I tried your suggestion, but it didn't affect anything.

I then opened a one week old copy of my database that behaved itself and configured the current copy to the same as the old. I made sure the database's document window was still set to overlapping, but still with no joy. I then set the document window back to tabbed and everything is now working ok. I guess there's a bug in 2007, hay ho.

Cheers anyway

D
 
In order for you to be able to force the size of your forms in the OnOpen event, you must ensure that the current database document windows option is set to Overlapping Windows. The change will not take effect until you close the database and then reopen it.
 
Yes I know I did all that and it didn't work.

Flipping the database back from overlapping to tabbed and deleting the on open sub routine reset the form and now it will open correctly in pop up format.

As I said there must be a bug in 2007, but hay ho you live and learn.

Cheers

D
 

Users who are viewing this thread

Back
Top Bottom