Is this what you wanted?
VB Code:
  1. Private Sub Form_KeyPress(KeyAscii As Integer)
  2. Select Case KeyAscii
  3.     Case Is = vbKey1
  4.     MsgBox "Pressed 1"
  5.         'code for KeyPressed = 1
  6.     Case Is = vbKey2
  7.     MsgBox "Pressed 2"
  8.         'code for KeyPressed = 2
  9.     Case Is = vbKey3
  10.     MsgBox "Pressed 3"
  11.         'code for KeyPressed = 3
  12. End Select
  13. End Sub