T
ThomasAJ
I have a string that I wish to write to a text field when Alt+1 is pressed.
The following code does not work as the form's KeyDown event is executed when
the Alt key is pressed and at that time it does not know that the '1' key has
been pressed.
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Dim blnAlt As Boolean
blnAlt = (Shift And acAltMask)
If blnAlt Then
If (KeyCode = vbKey1) Then SendKeys strAlt1, True
End If
End Sub
The following code does not work as the form's KeyDown event is executed when
the Alt key is pressed and at that time it does not know that the '1' key has
been pressed.
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Dim blnAlt As Boolean
blnAlt = (Shift And acAltMask)
If blnAlt Then
If (KeyCode = vbKey1) Then SendKeys strAlt1, True
End If
End Sub