Function keys assign

  • Thread starter Thread starter Marcelino Benitez via AccessMonster.com
  • Start date Start date
M

Marcelino Benitez via AccessMonster.com

hi guys, How I can assign function keys . Like I want F6 to give me the
today's date in a field.
 
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
 
BTW, there is an inbuilt shortcut ket for today's date already. It is CTRL +
;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top