>>>>>Have you tried testing thisform.ActiveControl.name ?
>>>
>>>Why would you compare the name? Compare the reference to avoid the problems you mention no? I've used this approach in many apps and it works well enough...
>>
>>Checking thisform.ActiveControl for null and then checking thisform.ActiveControl=this should suffice, like I said below.
>>
>
>thisform.ActiveControl can't become null.
>VFP fires an error when ActiveControl is not defined ( a bad design ! )
Yes, now I remember. That part of the framework was done with and buried long ago - try/catch to get a reference to it, or return a null if it won't. Bad design, indeed.