Is this what you wanted?
VB Code:
Private Sub Form_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case Is = vbKey1 MsgBox "Pressed 1" 'code for KeyPressed = 1 Case Is = vbKey2 MsgBox "Pressed 2" 'code for KeyPressed = 2 Case Is = vbKey3 MsgBox "Pressed 3" 'code for KeyPressed = 3 End Select End Sub




Reply With Quote