How to assign F12 key to act as if clicking a button?

  • Thread starter Thread starter Jack Ling
  • Start date Start date
J

Jack Ling

Hi,


I've a form for data input. There is an <Add Record> button
on the form. Instead of clicking the button to active the
function underlies it, our user want to use a short-cut
key, say, F12 key on keyboard to faciliate faster data entry.

Any idea?

thanks in advance,
Jack Ling
 
If you want F12 to behave like this across all forms, you could create a
macro named AutoKeys. In the Macro Name column (if you don't see this in
macro design view, it's on the View menu), enter:
{F12}

If this is just for one form, set the form's KeyPreview property to Yes, and
use the KeyDown event to check if KeyCode = vbKeyF12.

Explicitly save the record before you move to a new one. This will trigger
the entire series of events that may need to be handled, such as the Exit or
BeforeUpdate of the text box being edited, and the BeforeUpdate or Error
event of the form.
 
Hi, Jack.

For even faster data entry, you could use a hot key, which will allow the
user to keep fingers on and near the home keys of the keyboard, instead of
stretching all the way over to the function keys. To do so:

1.) Open the form in design view.
2.) Open the Properties dialog window.
3.) On your "Add Record" button, change the Caption Property to add an
ampersand before the character to be used as the hot key, such as the
following:

&Add Record

4.) Close the Properties dialog window and save the form.
5.) Open the form in form view. Notice that there is now an underlined A
in the caption of the "Add Record" button. This is the hot key.

Now, to add a record just press <ALT>A on the keyboard to simulate clicking
the "Add Record" button with the mouse (or the equally time-consuming
tabbing over to the button, then pressing <ENTER>).

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.
 
Back
Top