Getting position of a control on a form using code?

W

WSF

Access97
Is it possible to get (rather that set) the position of a control on a
form? I use a small calendar that I would like to appear immediately
below the command button calling the calendar.

As I use this calendar on many different forms I figure that if I can
determine where the command button is positioned on the form I can set
the MoveSize on the calendar form automatically. Also, if I move the
command button in design view I wouldn't have to worry about the
calendar position.

Presently the calendar is set to Auto Centre - not the best for my purposes.

Or is there another way?

Thanks,
WSF
 
S

Stephen Lebans

See:
http://www.lebans.com/openform.htm

A97OpenFormRelativeToControl.zip is an MDB showing how to open a second Form
relative to a control on the parent Form.

Version 1.5

Onno Willems added logic to support controls on TAB pages. Fixed logic Bug
for LEFT setting..



Version 1.4

Added logic to handle form's with their Popup property set to True. Added
support for the following positions relative to the specified control.

' 0 = Underneath
' 1 = On Top
' 2 = Right Side
' 3 = Left Side
' 4 = Bottom Right Hand Corner
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
W

WSF

Stephen,
Absolutely brilliant.
Incredible that I ask the question and have the ideal solution in less
than half an hour.

Thank you,

Bill Fraser
 

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