Hi all,
I have a subform placed on a tab control, and I'm having a terrible
time with proper tab order. I'm trying to allow the user to tab from
the last control on my subform to a control on the same page on the tab
control on the parent form.
The control (a button) on the subform executes the following code On Key
Down:
Private Sub AddContactButton_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyTab And Shift = 0 Then
Me.parent.Form.signaturePresent.SetFocus
End If
End Sub
The problem is that the focus is ending up on the control _after_
signaturePresent, which is off of the tab control page. If I place
statements in the event code for signaturePresent's Got Focus event they
run, but whether or not they run, the focus always seems to go to the
next control. The same thing happens when I apply this technique to a
different subform in the same form.
It seems as though there is a "leftover" tabbing event, and this fires
after the SetFocus action completes, and sends you to the control after
the one you specified. Is there any way to flush that event out or
otherwise get rid of the extraneous tab event?
Thanks,
Eric