David McAFee (Home)
dmcafee at pacbell.net
Mon Jun 9 12:06:07 CDT 2003
In you form's properties, set "key preview" to "yes" and place the following code in the "On Key Up" event: Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer) Select Case KeyCode Case 27 'Escape was pressed KeyCode = 0 'Setting a keycode to 0 will "disable" that key's function Case 114 'F3 was pressed Call YourFunctionNameHere() Case 116 'F5 was pressed Msgbox "F5 was pressed" Case 117 'F6 was pressed Msgbox "F6 was pressed" Case 119 'F8 was pressed Msgbox "F8 was pressed" Case 120 'F9 was pressed Msgbox "F9 was pressed" Case 121 'F10 was pressed Msgbox "F10 was pressed" 'Case vbKeyF12 'F12 was pressed '<-- Can also call this way 'Msgbox "F12 was pressed" End Select End Sub HTH David McAfee -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Reuben Cummings Sent: Monday, June 09, 2003 9:41 AM To: AccessD Subject: [AccessD] Function Keys - A2K How do I access the powers the function keys in an Access app? I want to use F3 (or whatever) to perform a certain function. How can I call the function using an F3 keypress? Thanks. Reuben Cummings Director of Software Development GFC, LLC phone: 812.523.1017 email: reuben at gfconsultants.com _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com