Error with code

gary.newport

Registered User.
Local time
Today, 07:13
Joined
Oct 14, 2009
Messages
79
I have the following code, which was given to me, that is meant to centre the form on the screen. I am aware that it is not working and in fact creates further errors in the code.

Code:
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2

However, I am unsure why this does not work.
 
maybe it doesn't matter. how about just using the autocenter property of the form? I've learned the hard way too, that doing math like this to try and manipulate screen placement will come back to haunt you. There's one opinion
 
I have but it does not always seem to work. Not too sure why so thought I would use code to secure a centred position.
 
I have but it does not always seem to work. Not too sure why so thought I would use code to secure a centred position.

i can almost guarantee you that the code will work even less than the autocenter will, although I don't know for sure.

there must be a reason why the ac property isn't working. might want to check on that. never seen it not work. it might be part of a combo of props you have set that don't like each other. for example, MOVEABLE = NO, MODAL = YES, or perhaps POPUP = YES? worth a check
 
I thought the same one. I note that a lot of references have auto resize as no whilst setting auto center as yes. I can also confirm that I have Modal and Pop-Up set as NO and Moveable set as YES. This is on the one form that centres left-right but not top-bottom.

All others are centering nicely. Not sure why auto resize should affect auto center; maybe it's just me going mad!
 
maybe it's just me going mad!

i seriously doubt it. Access is not the greatest program ever written unfortunately. i'm sure your prob has been encountered by someone else, but I've never seen it personally. good luck brother.
 
hi guys

not that this has any relevance to the post but i was writing code for autocad once and a i was wanting to get the perimeter of an arc. the math for this is

circumference = radius x 2 x Pi (3.142)
degrees of chord ( say 45 )

length of arc = circumference / 360 x degrees

a calculator worked this out just fine, a pencil on paper worked this out just fine too but in code, i had to divide Pi by 2 & double the degrees of chord to get the correct calculation which made absolutely no sense what so ever!!

i wasnt even going to attempt Sin........lol



nidge
 

Users who are viewing this thread

Back
Top Bottom