B
Bishop
I have a userform with 3 buttons and the following code:
Private Sub AddButton_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, _
ByVal Shift As Integer)
Dim A As Integer
If Chr(KeyCode) = "A" Then
Unload AddOrFind
AddTitle.Show
End If
End Sub
Private Sub FindButton_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, _
ByVal Shift As Integer)
Dim A As Integer
If Chr(KeyCode) = "F" Then
Unload AddOrFind
Search.Show
End If
End Sub
Private Sub SummaryButton_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, _
ByVal Shift As Integer)
Dim A As Integer
If Chr(KeyCode) = "V" Then
Unload AddOrFind
Summary.Show
End If
End Sub
The userform initiates with the first button active. If I press "a" then I
get the desired result. But the other two buttons do no respond to the
keydown unless I tab to that button to make it active. I would like to be
able to press any of the 3 buttons without having to tab. How do I
accomplish this?
Private Sub AddButton_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, _
ByVal Shift As Integer)
Dim A As Integer
If Chr(KeyCode) = "A" Then
Unload AddOrFind
AddTitle.Show
End If
End Sub
Private Sub FindButton_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, _
ByVal Shift As Integer)
Dim A As Integer
If Chr(KeyCode) = "F" Then
Unload AddOrFind
Search.Show
End If
End Sub
Private Sub SummaryButton_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, _
ByVal Shift As Integer)
Dim A As Integer
If Chr(KeyCode) = "V" Then
Unload AddOrFind
Summary.Show
End If
End Sub
The userform initiates with the first button active. If I press "a" then I
get the desired result. But the other two buttons do no respond to the
keydown unless I tab to that button to make it active. I would like to be
able to press any of the 3 buttons without having to tab. How do I
accomplish this?