>>Your suggested approach is quite similar to what I had started trying. The key from your post was that there is no magic bullet solution, so you got me back to work on the problem. It’s working now, and here’s what I ended up with:
>>
>>A global (public) variable gcCameFrom
>>
>>For each txtBox, or other control, that changed the grid’s RecordSource content
>>In GotFocus()
gcCameFrom = This.Name
>
>Except that this.name is relative to .parent; if you have instantiated a same composite class several places - say, a container with two or three textboxes to enter phone number, area code,
internat country code etc - the members of that container will have the same names in every instance, names you can't change.
>
>I'd suggest
gcCameFrom=sys(1272, this)
>
>which would give you full hierarchy, or even
>
>
goCameFrom=this
>
>as a direct object reference, but in that case you'd have to make sure you clear that when your form loses focus.
Dragan
Using "this" was my initial approach, but I couldn't figure out how to use it to setfocus. With gcCameFrom = this.name ... I use
with thisform
.&gcCamefrom..setFocus()
but this syntax doesn't work with goCameFrom = this when I use ...
with thisform
.&goCameFrom..setfocus()
I get a syntax error. What would be the right syntax to do a setfocus() for goCameFrom?
Bob