open form NOT maximized

J

Jean-Paul

I posted a question how to open a form maximized...
I got this suggestion:

Private Sub Form_Open(Cancel As Integer)
DoCmd.Maximize
End Sub

This works perfectly

How to open a form not maximized...

The maximized form has some puchbuttons, one of them is to open a report
in preview mode. This also opens maximized while it better shouldn't...
so how to open it "less maximized"...

(if you understand ;))

Thanks
 
A

Al Campagna

Jean-Paul,
See Restore Method in Help.
Using this code in the Form's OnOpen event
DoCmd.Restore
will reduce a maximized window to a sizable window, and increase a minimized
window to a sizable window also.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
M

MikeJohnB

Look up MoveSize method in VB Help

DoCmd.MoveSize 1440, 2400, 2500, 2000

DoCmd.MoveSize(Right, Down, Width, Height)

Right, the distance from the right side of the screen
Down, the distance down from the top of the screen
Width, the Width of the Form
Height, the height of the form

I believe the dimensions are in twips, there are 1440 twips per inch

AutoResize Property
Also note that Access opens the form in its last saved condition, if last
opened maximised and closed, it will open it maximised the next time unless
you apply different code as in the MoveSize. From the VB help, the following
information is displayed

When opened, the Form window has the last saved size. To save a Form
window's size, open the form, size the window, save the form by clicking Save
on the File menu, and close the form. When you next open the form, it will be
the saved window size

I hope this helps?
 

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