M
Mary
My Num lock is disabled after an On Click Event macro runs. I converted the
macro to vb to show the code:
Function CancelProject()
On Error GoTo CancelProject_Err
DoCmd.Close acForm, "ExistingProject"
SendKeys "{ESC}", False
SendKeys "{ESC}", False
SendKeys "{ENTER}", False
DoCmd.Close acForm, "Auto_Enter New Task"
DoCmd.Maximize
CancelProject_Exit:
Exit Function
CancelProject_Err:
MsgBox Error$
Resume CancelProject_Exit
End Function
The Sendkeys ESC commands are to clear the fields and the main form, Enter
is to click Yes to close that form. It all works the way I expected, but as
soon as I click the button, the Num lock is turned off. Can anyone tell me
why, and can this be changed so it stays on?
Thanks! Mary
macro to vb to show the code:
Function CancelProject()
On Error GoTo CancelProject_Err
DoCmd.Close acForm, "ExistingProject"
SendKeys "{ESC}", False
SendKeys "{ESC}", False
SendKeys "{ENTER}", False
DoCmd.Close acForm, "Auto_Enter New Task"
DoCmd.Maximize
CancelProject_Exit:
Exit Function
CancelProject_Err:
MsgBox Error$
Resume CancelProject_Exit
End Function
The Sendkeys ESC commands are to clear the fields and the main form, Enter
is to click Yes to close that form. It all works the way I expected, but as
soon as I click the button, the Num lock is turned off. Can anyone tell me
why, and can this be changed so it stays on?
Thanks! Mary