Link to home
Start Free TrialLog in
Avatar of ramrom
ramromFlag for United States of America

asked on

Position popup relative to a command button.

I want to position a popup to the right of a subform.

I presume to use movesize, but that requires coordinates relative to the screen.

I activate the popup from a command button on the subform.

How do I get the top and left coordinates of the subform relative to the screen so I can use movesize?
ASKER CERTIFIED SOLUTION
Avatar of Rick_Rickards
Rick_Rickards
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ramrom

ASKER

"Although this process may seem very daunting" ... actually it does not.I've been doing stuff like this for years. I just needed the pointer to the right API, and the sample code worked just fine.

Rather than messing with openargs and string parsing, I gave my form a move subroutine which takes the coordinates, sets focus to self and does the movesize.
I then docmd.openform and follow that with a call to the move sub.
Avatar of ramrom

ASKER

Oh Oh I just discovered that the above works fine if I feed GetFormDimensions() the main form, but I'm dealing with positioning the popup relative to a subform (actually a subform on a subform). I have not found a way to pass the subform to GetFormDimensions(). So I am back to square 1.
Avatar of ramrom

ASKER

Well ignore that. I found the right way to refer to the subform. It works.