Avatar of Fordraiders
Fordraiders
Flag 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

Microsoft AccessVBA

Avatar of undefined
Last Comment
Fordraiders

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
PatHartman

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Fordraiders

ASKER
THNX
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes