Change Focus When Entering a Subform

whdyck

Registered User.
Local time
Today, 14:29
Joined
Aug 8, 2011
Messages
169
I'm using MS Access 2003.

I notice that if I'm tabbing through a subform, then click into the main form, then tab through until the cursor again enters the subform, the focus immediately jumps to the last control in the subform to have had focus before I had clicked into the main form. Essentially, the Subform "remembers" where I was last and returns me to that same subform control.

I'd like to change this behavior so that, when I tab into the subform, the focus always goes to the first control in the subform's tab order sequence.

Can this be done? I tried adding code to the Subform's GotFocus event:
Code:
Private Sub Form_GotFocus()
    cmbSettlingPartyID.SetFocus
End Sub
(cmbSettlingPartyID is the first control in the subform's tab order sequence.)
However, this didn't seem to work.

Thanks for any help you can give.

Wayne
 

Users who are viewing this thread

Back
Top Bottom