A
Atlas
Hi everyone,
I was looking for an explaination about the Keydown event queue, trying to
understand if there's a wise Keydown event management on forms/controls, alà
what has to be done formwide it is stuffed into the form's keydown event
handler, and manage few exceptions int the control's keydown event handler.
Unfortunatelly it looks that code is executed in both the cases, in the
control and the form.
So my second question is if there is a way to executed control's code first,
then form's code, eventually aborting code execution in the control's
handler (avoiding form's keydown event execution).
So I was wondering if there's any best practice managing "cascaded" keydown
events in a form->controls fashion.
Particullarly what I would like to do is to manage the ESCape key as a
default UNDO & "close window" key, application wide.
This is how it should work:
On a form if users presses Escape:
1) Form is clean->docmd.close
2) Form is clean, current control is dirty->Undo control changes
3) Form is dirty, current control is clean->Ask if user wants to discard
changes, if so undo form and exit
4) Form is dirty, current control is dirty-> same as point 2.
The goal is minimizing code!
Any hint appreciated
Regards
I was looking for an explaination about the Keydown event queue, trying to
understand if there's a wise Keydown event management on forms/controls, alà
what has to be done formwide it is stuffed into the form's keydown event
handler, and manage few exceptions int the control's keydown event handler.
Unfortunatelly it looks that code is executed in both the cases, in the
control and the form.
So my second question is if there is a way to executed control's code first,
then form's code, eventually aborting code execution in the control's
handler (avoiding form's keydown event execution).
So I was wondering if there's any best practice managing "cascaded" keydown
events in a form->controls fashion.
Particullarly what I would like to do is to manage the ESCape key as a
default UNDO & "close window" key, application wide.
This is how it should work:
On a form if users presses Escape:
1) Form is clean->docmd.close
2) Form is clean, current control is dirty->Undo control changes
3) Form is dirty, current control is clean->Ask if user wants to discard
changes, if so undo form and exit
4) Form is dirty, current control is dirty-> same as point 2.
The goal is minimizing code!
Any hint appreciated
Regards