View Full Version : Can control positions be returned in VBA?


Everton
04-06-2001, 01:10 AM
Hi,

I'm trying to return the position of a label on a form using VBA. I know the top and left properties can be used to set the position, but is there any way of returning the position? What I want to do is find the position of a label then increment it by a set value after an event.

Any help apprectiated,

Paul.

Peter D
04-06-2001, 02:04 AM
You can use the Left and Top properties to determine the position of a control. Ex. (from a command button on your form):

msgbox "My control is at " & MyControl.top & ", " & MyControl.Left

Hope this helps,

Peter De Baets
Peter's Software - MS Access shareware and freeware http://www.peterssoftware.com

Everton
04-06-2001, 03:01 AM
Cheers,
Paul.

Atomic Shrimp
04-06-2001, 03:53 AM
Be aware that the Left, Top, Width and Height properties, when accessed from VBA, always work in 'Twips', regardless of your regional settings.

567 'twips' = 1 centimetre

Mike