Defining hotkeys. how to?

JohnGo

Registered User.
Local time
Today, 13:56
Joined
Nov 14, 2004
Messages
70
I would like to define several hotkeys:

F3 to start a search
CTRL+t to insert the current date in a date-field

and I guess more hotkey wishes will come up.
How can I easily define hotkeys within MS Access?
 
I found out the Ampersand to shortkey buttons in a form
(for instance ampersand the caption), but I'm looking for a more general shortkey for instance F3 to invoke search.
 
Change the KeyPreview property of your form to Yes. Then put the following code in the forms KeyDown event:

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF3 Then
MsgBox "F3 Pressed"
End If
End Sub

Hope this helps....
 

Users who are viewing this thread

Back
Top Bottom