Rob, believe it or not, you gave me a nudge to the right direction! I managed to solve this problem.
1) I set tabstop = false for cmdEdit but left it enabled. So you only could activate it with a mouseclick, but not by tab press.
2) Then I added a cmdTemp (tabIndex 1) right next to txtBarcode (tabIndex 0).
3) Now, what happens is this:
- Text is entered to txtBarcode. ENTER is inputed.
- Only option is to move to the object with the next tabindex = cmdTemp.
- Since cmdEdit has tabstop = false, focus cannot escape to that object.
- And cmdTemp_enter says: "txtBarcode.setfocus". Voila! focus switches back to the only other available object in the form - in txtBarcode.
- And cmdEdit is still clickable by mouse if needed.
Thanks for loaning your brains on this one.
- Mikael
Bookmarks