>>Ben,
>>
>>Chcek out ASelObj() and the Parent property of the object and then the parent property of its container and so on.
>
>Jim,
>
>When we are editing a method code, its object may not be currently selected. We might have clicked at a blank area of the form and ASelObj() does not create any array. Even worse, controls of another form (two forms are simultaneously opened) may be currently selected and the ASelObj() function puts irrelevant information into the array.
>
You can use AMOUSEOBJ(), and check the return - if it returns 0, the mouse isn't over a control or form. Pre-create the array and initialize it to NULL; you can detect whether or not you're positioned over a control on a form, or just a form (you're on the form, but no control is under the mouse. You can check individual members with ISNULL() that way.
>Ben.