Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

capture F1 key

Status
Not open for further replies.

ethorn10

Programmer
Feb 18, 2003
406
0
0
US
Hi all...

I was wondering if there was a way to capture the F1 key to launch a customized help page (html). I have a feeling it's a reserved key because I can get it to work with F2 and other keys but not F1. When I try to capture the F1 to launch MY help, it launches the ACCESS help instead.

Thanks ahead of time...
 
Hi ethorn10

In you Form's Properties Window:

Set Key Preview to Yes

In the Form's Key Down Event paste:

If KeyCode = vbKeyF1 Then
KeyCode = 0
MsgBox "You Pressed the F1 Key"
End If

Replace the Message Box with your code.

Good Luck

Bill
 
Works like a charm. Thanks. I had no idea about the Key Preview property.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top