Positioning form in specific location

D

DP

I wonder if there isn't a "simple" piece of code for programmatically
positioning a form's upper RIGHT hand corner EXACTLY in the upper right-hand
corder of the "Access" screen or desktop?

DoCmd.MoveSize 0,0 is beyond simple, of course, for situating the form in
the precise upper left corner of the screen, but I need the right corner!

Any help would be appreciated.

David Pike
 
P

PC Datasheet

Open one of your full screen forms in design view. Open properties and go to the
Format tab. Note what the form's width is. (My screen is 17" and full screen
forms are 8.0417" wide.)

For your other form that you want to position in the top right corner, put this
code in the on open event:
DoCmd.Movesize 8.0417*1440-Me.Width,0

Width is measured in Twips where 1" = 1440 Twips.

Put your width in place of the 8.0417.
 
D

DP

Thanks, I can see why that would work for you.

My problem is more complicated because (1) my forms are resizeable and (2)
the code needs to work, automatically, on other people's computers, which
may have different size monitors and different resolutions.

On mine, I have a huge monitor with resolution of 1920 across, for instance

I do have code that will give me the pixels of any screen in width, and
supposely, using the right calculations to convert pixels to twips, this
kind of code SHOULD indeed work:

DoCmd.MoveSize [SizeOfScreenWidthInTwips] - Me.Width, 0

But it doesn't. It will not precisely place the form, and I don't know why.

Thanks anyway!

David Pike
 
P

PC Datasheet

I just looked at the Help file and it says the measurements are in inches or
centimeters. Change the Twips to inches or centimeters and see if that makes a
difference.

Steve
PC Datasheet
 

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