Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
SetFocus Not working
Hello. I have a userform with a textbox and a commandbutton that are not
working as expected with regard to setfocus. After commandbutton3 is clicked, I want to set the focus to textbox3. This works just fine. However, I have a keydown event in textbox3 that runs commandbutton3_click sub if the enter key is pressed. When this event runs, everything works except textbox3.setfocus. Any help is appreciated. Private Sub CommandButton3_Click() If TextBox3.Value < Empty Then ListBox1.AddItem TextBox3.Value TextBox3.Value = Empty TextBox3.SetFocus End If End Sub Private Sub TextBox3_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer) If KeyCode = 13 Then CommandButton3_Click End If End Sub -- Thanks, Mike |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
setfocus | Excel Programming | |||
SetFocus not working | Excel Programming | |||
SetFocus not working as I would expect | Excel Programming | |||
SetFocus not working | Excel Programming | |||
setfocus | Excel Programming |