C
ChrisJ
Turn on the Form "KeyPreview" feature, and test for the
esc key in the form keypress or keydown event.
the AfterUpdate of Quantity (bound text box) and Price
(bound text box) as well as in Form_Current.
the "ESC" key without writing an OnKeypress event for
every control on the form?
the "Esc" key; the values of the two bound controls
revert, but the unbound control does not.
its Text property is set. The [Control].Undo event does
not work unless the particular control has the focus, so a
user could press ESC while another control has the focus,
again leaving the value of the unbound Total control
orphaned.
esc key in the form keypress or keydown event.
are bound text boxes. The UpdateTotals sub is called in-----Original Message-----
This is best explained by a very simple example:
Private Sub UpdateTotals()
Total = Quantity x Price
End Sub
"Total" is an unbound text box. "Quantity" and "Price"
the AfterUpdate of Quantity (bound text box) and Price
(bound text box) as well as in Form_Current.
when a user causes the Undo event to fire by pressingHow can I revert the value of the unbound Total control
the "ESC" key without writing an OnKeypress event for
every control on the form?
after Me.Undo. The problem occurs when a user pressesThe use of an Undo button allows me to call UpdateTotals
the "Esc" key; the values of the two bound controls
revert, but the unbound control does not.
not fire when the value of the control is set, only whenThe [Control]_Change event does not work because it does
its Text property is set. The [Control].Undo event does
not work unless the particular control has the focus, so a
user could press ESC while another control has the focus,
again leaving the value of the unbound Total control
orphaned.
values of the bound controls revert, not afterward.The Form_Undo does not work because it fires BEFORE the