F Keys (1 Viewer)

danian

Registered User.
Local time
Today, 06:06
Joined
Jun 27, 2005
Messages
54
Is it possible to use F keys to call Forms/Queries. I have used the code below and found when i press F7 spell ceck runs:

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF7 Then

Dim stDocName As String

stDocName = "qryDepartment1"
DoCmd.OpenQuery stDocName, acNormal, acEdit

End If
End Sub


I have put this code in the keydown on the form.

Do i need to disable the existing F keys duties

Thanks,
Danian
 

ghudson

Registered User.
Local time
Today, 01:06
Joined
Jun 8, 2002
Messages
6,195
I advise against doing that since the F keys have a common function for most Windows and Office programs. F7 = spellcheck, F2 = edit, F5 = refresh, etc.

If you insist on going down this path then you should research the AutoKeys macro.
 

ghudson

Registered User.
Local time
Today, 01:06
Joined
Jun 8, 2002
Messages
6,195
I advise against doing that since the F keys have a common function for most Windows and Office programs. F7 = spellcheck, F2 = edit, F5 = refresh, etc.

If you insist on going down this path then you should research the AutoKeys macro.
 

danian

Registered User.
Local time
Today, 06:06
Joined
Jun 27, 2005
Messages
54
Thanks for that.

Is it the possible to user a different combination i.e.

CTRL & Q

ALT & Q

Thanks
D
 

ghudson

Registered User.
Local time
Today, 01:06
Joined
Jun 8, 2002
Messages
6,195
The Access VBA help files will provide you with the information you need on using the AutoKeys macro.
 

Users who are viewing this thread

Top Bottom