Geoff,
The way I do it is to put code in the lostfocus event of my controls that stores the object in a form property call oLastfocus. Then I can evaluate oLastfocus when I need to.
procedure lostfocus()
thisform.oLastfocus = this
endproc
>Hi
>
>I am having problems with the ActiveControl property. I need to know which control had focus prior to a command button being clicked. I thought I would use BINDEVENTS to bind the GotFocus event of all the controls and then use the form's ActiveControl property to determine what control had focus.
>
>Unfortunately, I always end up with Thisform.ActiveControl not evaluating to an object,
>
>Why is this and how can I determine which control has focus?
>
>Regards
>Geoff Scott