LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default Keydown issue


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?
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Here is the syntax for TreeView.KeyDown(). [email protected] Excel Programming 0 May 13th 09 03:52 AM
Keydown Problem WLMPilot Excel Programming 4 January 11th 08 04:42 PM
keydown event Peter T Excel Programming 0 April 18th 05 02:03 PM
keydown event K Dales[_2_] Excel Programming 0 April 18th 05 12:46 PM
keydown event jim c. Excel Programming 1 October 10th 03 03:16 AM


All times are GMT +1. The time now is 02:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"