M
MarMo
hi there ,
On a userform , I have several textboxes and a listbox in a frame.
The listbox is the last object in the tabstop order in that frame.
On top of the form there is a commandbutton .
Each time when I push the ENTER key in the frame the tabstop moves to the
next object until it reaches the listbox.
To move to the next object ( the commandbutton ) from the listbox , I put
some code behind the listbox.Keydown event i found on the net.
Private Sub LstType_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 13 Then
Me.Commandbutton1.SetFocus
End If
End Sub
This works fine to move to the commandbutton , but when it gets the focus it
runs the On_click code.
I just want to get the focus on the commandbutton , not to execute the code
behind the button.
Is there a solution for this.
Kind regards for helping me .
Mario
On a userform , I have several textboxes and a listbox in a frame.
The listbox is the last object in the tabstop order in that frame.
On top of the form there is a commandbutton .
Each time when I push the ENTER key in the frame the tabstop moves to the
next object until it reaches the listbox.
To move to the next object ( the commandbutton ) from the listbox , I put
some code behind the listbox.Keydown event i found on the net.
Private Sub LstType_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 13 Then
Me.Commandbutton1.SetFocus
End If
End Sub
This works fine to move to the commandbutton , but when it gets the focus it
runs the On_click code.
I just want to get the focus on the commandbutton , not to execute the code
behind the button.
Is there a solution for this.
Kind regards for helping me .
Mario