Forum Discussion
hohai610
Feb 15, 2021Copper Contributor
How i can set up a keystroke for an action MS ACCESS
HELLO EVERYONE ,PLEASE HELP ME ON THIS I HAVE A TEXT BOX IN A FORM. I WOULD LIKE TO ADD AND DELETE QUANTITY INSIDE THE SUBFORM BY THAT TEXT BOX. THIS IS WHAT I WANNA DO. ADD :I WILL INPUT A NUMBER...
Feb 15, 2021
Could you not use the key press event?
https://docs.microsoft.com/en-us/office/vba/api/Access.Form.KeyPress
https://docs.microsoft.com/en-us/office/vba/api/Access.Form.KeyPress
- hohai610Feb 15, 2021Copper Contributor
hi ,thank you for reply
Can you show me a easy example for keypress event please ?- George_HepworthFeb 16, 2021Silver Contributor
Here's an easy example. Create a procedure like this:
Public Sub CaptureKeyPress(ByVal KeyANSI As String)
MsgBox KeyANSI
End SubUse it like this:
Private Sub TextYourControlNameGoesHere_KeyDown(KeyCode As Integer, Shift As Integer)
Call CaptureKeyPress(KeyCode)
End Sub