Link to home
Start Free TrialLog in
Avatar of developingprogrammer
developingprogrammer

asked on

test keycode for alphanumeric character

guys,

i have a keydown event and only want to run if an alphanumeric character is pressed. i think this is a UDF requirement.

how would yall design it? if yall could share even some air code that would be great!!

i'm so so sorry i'm so super overloaded now!!

i'm thinking something like convert the keycode to alpha and then test it for >=A <=z and also for numbers. can't think of the exact implementation but something along those lines! thanks guys!! = ))
Avatar of Anthony Berenguel
Anthony Berenguel
Flag of United States of America image

Here's an example I have used before -- you will need to modify the selection statement to fit your needs.

Private Sub cbxControl_ID_KeyPress(KeyAscii As Integer)
    Debug.Print KeyAscii
    If KeyAscii = 27 Then 'esc key
        Me.cbxControl_ID.Width = 1440
    End If
End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of als315
als315
Flag of Russian Federation image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of developingprogrammer
developingprogrammer

ASKER

great! thanks aebea and als315!! = ))