|
Question : MS Access 2003 - Assign Current Date and Current time to two different keystrokes
|
|
Here is what I am trying to do. I have a form that has the date field and a separate time field. I want the user to press CTRL + D and have the system date entered into the selected field and then when the user presses CTRL+T, have the current time entered into the selected time field.
I do know about CTRL +: but it would be easier to do this with CTRL + D and CTRL + T.
Thanks in advance for your assistance.
Lou
|
|
Answer : MS Access 2003 - Assign Current Date and Current time to two different keystrokes
|
|
try using the AutoKeys macro, see if that helps
http://www22.brinkster.com/accessory/macros/002.shtml
u could create functions
public function InsDate() Screen.ActiveControl.Value = Date() end function
public function InsTime() Screen.ActiveControl.Value = format(Now(),"Short Time") end function
One thing to add though, if u want this specific to a form then u need to ensure u check the form name otherwise your keys will work allover
note, once u create Autokeys u have to restart DB
e.g.
Public Function InsDate() If Screen.ActiveForm.name = "frmMyForm" Then Screen.ActiveControl.Value = Date() End Function
this works well as Ive just tested it
then call these via macros
|
|
|