M Marcelino Benitez via AccessMonster.com May 27, 2005 #1 hi guys, How I can assign function keys . Like I want F6 to give me the today's date in a field.
A Alex White MCDBA MCSE May 27, 2005 #2 Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyF6 Then Me.Text1.VALUE = DATE End If End Sub This will do this for the specific field when it has focus to do this at a form level you need to set the "Key Preview" property for the form to yes and set the event handler for the form for KeyDown event
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyF6 Then Me.Text1.VALUE = DATE End If End Sub This will do this for the specific field when it has focus to do this at a form level you need to set the "Key Preview" property for the form to yes and set the event handler for the form for KeyDown event
W Wayne Morgan May 27, 2005 #3 Another alternative is to create an AutoKeys macro. For more information, check this link or the help file. http://msdn.microsoft.com/archive/d.../en-us/office97/html/makingkeyassignments.asp
Another alternative is to create an AutoKeys macro. For more information, check this link or the help file. http://msdn.microsoft.com/archive/d.../en-us/office97/html/makingkeyassignments.asp
V Van T. Dinh May 28, 2005 #4 BTW, there is an inbuilt shortcut ket for today's date already. It is CTRL + ;