GK in the UK
Registered User.
- Local time
- Today, 10:35
- Joined
- Dec 20, 2017
- Messages
- 281
Per the title. In my TabCtlDetail_Change sub, I try to set focus to the sub form, then the sub form control. It doesn't work. Despite, Access reporting that that is where focus is.
TabCtlDetail_Change calls a sub to bind the page, then attempts to set focus as the last two lines.
I put a command button on the form to test with the same two SetFocus lines. Clicking it immediately after changing the tab sets the focus correctly. So the code is ok.
If I click to a different tab, then click back, focus is in the field. But never on first binding. In fact, I don't know where focus is.
Access reports:
Screen.ActiveControl.Name reports txtPickQty
Me.ActiveControl.Name reports OrderLines
But it isn't. So where is the focus ?
There's an issue which I think is related. I want focus to go to the sub form, because I want to test for KeyUp and KeyDown. On first click of the tab page, KeyDown fires, but KeyUp never does. Until I focus the field. How can the sub form, which must be active if it's responding to KeyDown, not respond to KeyUp ?
TabCtlDetail_Change calls a sub to bind the page, then attempts to set focus as the last two lines.
I put a command button on the form to test with the same two SetFocus lines. Clicking it immediately after changing the tab sets the focus correctly. So the code is ok.
If I click to a different tab, then click back, focus is in the field. But never on first binding. In fact, I don't know where focus is.
Access reports:
Screen.ActiveControl.Name reports txtPickQty
Me.ActiveControl.Name reports OrderLines
But it isn't. So where is the focus ?
There's an issue which I think is related. I want focus to go to the sub form, because I want to test for KeyUp and KeyDown. On first click of the tab page, KeyDown fires, but KeyUp never does. Until I focus the field. How can the sub form, which must be active if it's responding to KeyDown, not respond to KeyUp ?