Button Moves

Harry Taylor

Registered User.
Local time
Today, 09:13
Joined
Jul 10, 2012
Messages
90
I have a form with a simple open button to open a phone book form;

1725878954586.png


When I open the database (FE) from some pc's the button moves;

1725879052667.png


I have around 10 other buttons on the form which are fine. Only this on moves.

Any thoughts?
 
I have that happen to some of my forms, but not that much.
The Close should be on the bar just above where it is
1725881396773.png
 
on design view of your form, "Arrange" (ribbon) your controls and "stacked" them.
arrange.jpg
 
include those buttons.
 
You can position any object on the screen. I do it in the OnLoad.
I have a series of standard buttons and I'll set which I need and where to place them along the bottom of the screen, or vertically on the right, or some other position I want them to be with a Function.
That way I don't need to position or arrange them using the Ribbon. In fact I don't much care where they are when in design. The instant the screen opens, they will be where I need them to be and with the spacing I've set. Same with their size. they'll all be sized the same, if or not they are the same in Design. In a year you can waste hours positioning and sizing buttons. Why bother when Access will do it for you?

Access requires the position in Twips. I'd suggest that you try 56.69 per mm but it can change due to screen res.

For example a Desktop 1920x1080x24" screen:
97.93 pixels / inch or 1mm = 3.86 pixels
In access a form size 196.63mm x 274.83mm is in Twips = 11149 x 21253
You'll find loads of stuff online on pixels per screen size and pixels to twips calcs to help you with this.
You can see an Object's position in cm when in Design with PropertySheet-Format Tab, Width, Height, Top, Left.
Then all you do is in your OnLoad event.
Me.buttonNAME.Properties("Top") = TopPositionInTwips
Me.buttonNAME.Properties("Left") = LeftPositionInTwips

In fact, you could OnLoad calculate the far right position of Phone-field and the bottom position of Phone-field.
Then place your button with required gaps using those dims. An interesting little exercise to get the hang of it all.
Then if the field sizes, or position changes, the button will move with them.
 
Really you should set twips to be a multiple of 15 as there are 15 twips to a pixel - not sure of the rounding rules but 3.86 pixels will round to either 3 or 4.

That’s why if you set a position in properties as say 15.35cm it might change to 15.346

Not sure about hd monitors - might be a different ratio

Ideally Google ‘twips to pixels’ to find the method of getting the exact ratio for a monitor
 
Thank you all for your input.
I gave up. I deleted the button and created a new one. everything works fine. Note sure why, the properties etc are the same as before (I think)
 
Really you should set twips to be a multiple of 15 as there are 15 twips to a pixel - not sure of the rounding rules but 3.86 pixels will round to either 3 or 4.
I'm not particularly sure why you need to round anything. Particularly the larger pixel measurement.
If a cm = 566.929, or 567 twips then you are simply using twips as a method of measurement. On the screen all objects are using 56.7 per mm on 96DPI. Or 57.9 in your example.
If I have a form 34cm wide that is (340x56.7) 19,278 Twips and the position for each of the objects can be set using those calculations. If I want a 2mm gap between buttons, or a 2mm gap vertically between fields. Then the space is a variable with the value of 2x56.7 and I am little interested what exactly that value is, or even if it is rounded to an integer. I simply want them close to 2mm apart. Each gap will always be that same variable value calculated when the program runs.
Just not sure why you would see the need to round pixels.
 

Users who are viewing this thread

Back
Top Bottom