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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Autokeys

Status
Not open for further replies.

Krystoff

MIS
Sep 18, 2002
129
0
0
US
Hey all!

Heres a quick question on autokeys.

I have a form, there is a button on the form called cmdSearch.

From anywhere in that form, I want the user to be able to press the F12 function key and have it be the same as if they had clicked that button.

Any ideas?
 
You'll need to include code in the form's on load and KeyDown Procs.

Please see below.

Private Sub Form_Load()
Me.KeyPreview = True
End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyF12
'Enter Your code here.
End Select
End Sub


hope this helps you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top