Link to home
Create AccountLog in
Avatar of Fordraiders
FordraidersFlag for United States of America

asked on

allow tab key in select case for ascii vba

i'm having an issue that when a person presses a  <tab> key going from textbox to textbox,

The code below is firing off in the next textbox in the tab order. even though I have not pressed keys in that next textbox yet  ?

The event i have it on is..
Private Sub QUOTE_GP_KeyPress(KeyAscii As Integer)

Select Case True 'always your best friend
    Case (KeyAscii > 47 And KeyAscii < 58)
    Case (KeyAscii = 8)
    Case (KeyAscii = 43)
    Case (KeyAscii = 45)
    Case (KeyAscii = 46)
    Case Else
      '  MsgBox ("quote gp You Must Enter Numbers Only!")
        KeyAscii = 0
        Exit Sub
End Select

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of PatHartman
PatHartman
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Fordraiders

ASKER

THNX