By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,955 Members | 1,768 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,955 IT Pros & Developers. It's quick & easy.

"Leftover" tab

P: n/a
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
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Eric, if the "AddContactButton" is a button, why aren't you using the
"Click" event of the button to run the setfocus.

The code below runs when you click button "Command17". Command17 is a button
on a subfrm located on a tab control and cmdCopyPasteApprovedVendorChgs is a
button on the Paren form. Click the button "Command17" and the
cmdCopyPasteApprovedVendorChgs button gets the focus.

Private Sub Command17_Click()
Me.Parent.Form.cmdCopyPasteApprovedVendorChgs.SetF ocus
End Sub

Regards,
Barry

"Eric E" <wh*******@bonbon.net> wrote in message
news:hd********************@speakeasy.net...
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

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.