-
whats the problem?
Private Sub form_keypress()
If Keycode = vbKeyA Then
Command20_Click
End If
End Sub
error:
procedure decloration does not match description of event or procedure having the same name
Private Sub form1_keypress()
If Keycode = vbKeyA Then
Command20_Click
End If
End Sub
however has no error but does nothing.
-
because keypress() isn't the correct event name... try
Private Sub Form_KeyPress(KeyAscii As Integer)
If keyascii = vbKeyA Then
Command20_Click
End If
End Sub
-
works, but i have to press shift + a for it to work. even with the A being lowercase in the code. (i thought it may have been the uppercase) know why?
-
no, my code worked perfectly fine for me... i tried it before i posted
-
thats odd. ill just prompt caps lock usage. no biggie.
thanks
-
vbKeyA value is 65, for 'a' use
if KeyAscii = 97 then
' do something
end if