Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Hisham Younis   on Nov 24 In MS Office Category.

  
Question Answered By: Joseph Evans   on Nov 24

I HATE to suggest this, but... how about using SendKeys to send a Shift-Tab?
This worked every time for me, even after adding additional controls to the form
and changing the tab order several different ways.

Private Sub txtStringLineInput_KeyDown(ByVal KeyCode As MSForms.ReturnInteger,
ByVal Shift As Integer)
If KeyCode = 13 Then
If Len(Me.txtStringLineInput.Text) > 0 Then
Me.lstStringSetData.AddItem Me.txtStringLineInput.Text
End If
Me.txtStringLineInput.Text = vbNullString
Application.SendKeys "+{TAB}"
End If
End Sub

Private Sub UserForm_Initialize()
Me.txtStringLineInput.SetFocus
End Sub

Share: 

 

This Question has 20 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on 2003 - Setfocus on userform Or get search suggestion and latest updates.


Tagged: