If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How to assign F12 key to act as if clicking a button?
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 |
#2
|
|||
|
|||
How to assign F12 key to act as if clicking a button?
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. -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Jack Ling" wrote in message ... 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 |
#3
|
|||
|
|||
How to assign F12 key to act as if clicking a button?
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 ALTA 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. "Allen Browne" wrote in message ... 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. -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Jack Ling" wrote in message ... 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 |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Assign Functions to Control Button | Teknologist | Worksheet Functions | 1 | August 5th, 2004 08:31 AM |
assign macro to command button on worksheet | Mike V | Worksheet Functions | 2 | December 17th, 2003 10:51 PM |