Returning focus to parent from subform with Tab key
Posted on 2011-09-13
I have been hacking away at this for hours and cannot come up with a reliable solution that doesn't involve all sorts of trickery with dummy controls, etc. There must be a better way....
I have a continuous form embedded in another form. When I reach the last control in the last record, and I hit the tab key, I want control to return to the main form. Seems like this should be easy. But the weird thing is, KeyUp fires AFTER focus has shifted, so I can't find a way to pickup the Tab from the last control. In other words, let's say there are two controls, tbxBoxA and tbxBoxB. Box B is the last control and is listening for key strokes. If hit hit any key OTHER than tab, it picks it up. But If I'm in tbxBoxA, and I hit Tab, control moves to B (as expected), but then B's KeyUp says "Tab was pressed". That makes no forking sense in my opinion, but so be it. So I dunno what to do. Any ideas?