Link to home
Start Free TrialLog in
Avatar of pmcontractor
pmcontractorFlag for United States of America

asked on

When I Open a form, I want to position it at a certain place on the screen.

When I Open a form during the execution of an application, how do I:

1. Using VBA, how do I place it in a certain position each time?
2. At the same time I would like to hide the form that called for it!
Avatar of flavo
flavo
Flag of Australia image

Go in to design mode, put the form where you want it, press save (make sure auto centre is turned off in the properties) and bob's your uncle!

Good Luck!

Dave
ASKER CERTIFIED SOLUTION
Avatar of flavo
flavo
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Greetings!

I normally add Docmd.Restore to the form's Form Open event also.

-Silly-
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of moralju
moralju

YOu can also place this in your Form open property and make the Access Container Maximize

'Maximize Access window
fSetAccessWindow (WM_SW_MAXIMIZE)
or you could do it the easy way.. re my first post
Flavo, I really think its up to pmcontractor to decide.
debating over who has a better option is a waste of space and time.

As per EE culture..
Avatar of Benjamin Lu
Just using Movesize action is enough

You can use the MoveSize action to move or resize the active window.

Setting

The MoveSize action has the following arguments.

Action argument      Description
Right      The new horizontal position of the window's upper-left corner, measured from the left edge of its containing window. Enter the position in the Right box in the Action Arguments section of the Macro window.
Down      The new vertical position of the window's upper-left corner, measured from the top edge of its containing window.
Width      The window's new width.
Height      The window's new height.

Best Regards


Ben