Form position

M

Michael

I have worked out how to get my Access 2K Db window to open in the
centre of the screen with the first form maximised. I now need to
make a pop up form appear in the top right hand corner of access
window (or the top Right hand corner of the maximised form). I have
found code in the forums but it seems to apply to the form area and
will not work when the form is maximised, despite playing around with
it for a few weeks I can not make it work.
OK what would be a God sent is if someone more cleaver than I could
send me an example where this actually works :)
Thanks
Michael
 
F

fredg

I have worked out how to get my Access 2K Db window to open in the
centre of the screen with the first form maximised. I now need to
make a pop up form appear in the top right hand corner of access
window (or the top Right hand corner of the maximised form). I have
found code in the forums but it seems to apply to the form area and
will not work when the form is maximised, despite playing around with
it for a few weeks I can not make it work.
OK what would be a God sent is if someone more cleaver than I could
send me an example where this actually works :)
Thanks
Michael

Michael,

Look up the MoveSize method in VBA help.

Set the Form's AutoCenter property to No.
Code the Form's Load event:

Forms!frmDates.MoveSize 4 * 1440, 0

All measurements are in twips (1 inch = 1440 twips).
You haven't posted how wide the form is, so the above will place the
left side of the form 4 inches from the left side of the window.
Change the position as needed. Note, you might want to drop the form
down a bit, as it will cover the tool buttons if you set it at 0.
 
M

Michael

fredg said:
Michael,

Look up the MoveSize method in VBA help.

Set the Form's AutoCenter property to No.
Code the Form's Load event:

Forms!frmDates.MoveSize 4 * 1440, 0

All measurements are in twips (1 inch = 1440 twips).
You haven't posted how wide the form is, so the above will place the
left side of the form 4 inches from the left side of the window.
Change the position as needed. Note, you might want to drop the form
down a bit, as it will cover the tool buttons if you set it at 0.

Hi Fred,
Thanks for a speedy reply. I started with the Movesize command which
works fine
until the window gets moved on the screen then the popup opens in the
wrong place. I know it can be done with API calls and I am trying to
learn how. I can get the Access window position in pixels and I have
tried to use these figures with the MoveSize....didn't work :(
Michael
 

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