Control location on screen where form opens?

P

plh

Access 2010:
In my application there is a spot where users use a command button to
open two forms at the same time. They open on top of each other as
expected. It would be nice if I could open them side by side. Is there
a way to do that, control where on the screen they open? I seem to
remember seeing something about it, but I searched in this group using
various search strings but turned up nothing.
Thanx,
-plh
 
D

David-W-Fenton

:
Access 2010:
In my application there is a spot where users use a command button
to open two forms at the same time. They open on top of each other
as expected. It would be nice if I could open them side by side.
Is there a way to do that, control where on the screen they open?
I seem to remember seeing something about it, but I searched in
this group using various search strings but turned up nothing.

There are two ways:

1. turn off autopositioning and position the forms onscreen and hit
Ctrl-S on the keyboard.

2. in the form's OnOpen event, use the DoCmd.MoveSize command (it
will operate on the currently active object, so could be somewhat
unreliable if there's something weird during the OnOpen events of
your forms).

3. use Windows APIs to position the windows:

http://access.mvps.org/access/forms/frm0042.htm

The latter is by far the most reliable in terms of end results, but
can give unpredictable results if you're trying to size the form
(which you're not, so not a concern). The issue there is that
different Windows chrome causes the sizes of Windows to be
different.
 

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