I want to detect whether the down arrow is pressed or not in a field on a form in Access 2000.
Can I do something with the ascii-code, and what is the ascii-code for the down arrow ?
Do I have to use the keypress event ?
use the KeyDown Event for the textbox, ensure you set the Form's KeyPreview Event to Yes. This Code will get you started
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 38 Then
MsgBox "UpArrow"
ElseIf KeyCode = 40 Then
MsgBox "DownArrow"
Else
MsgBox "Other Key"
End If
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.