Event that fires everytime any value in any control changes...

  • Thread starter Thread starter Rajesh B. Patel
  • Start date Start date
R

Rajesh B. Patel

Is there an event that fires everytime any value in any control on a
particular form changes changes? I am trying to avoid writing the same
code over and over in the "On Change" and "Before Update" events of all
the comboboxes and textboxes on a form.

Thanks.

raj
 
look at your form events, rather than control events.
in the Properties box, click on the line of any event to "select" it, and
press F1. the Access Help topic will open and tell you everything you
probably need to know about that event, including when it fires.
 
Rajesh said:
Is there an event that fires everytime any value in any control on a
particular form changes changes? I am trying to avoid writing the same
code over and over in the "On Change" and "Before Update" events of all
the comboboxes and textboxes on a form.


No, there is no one event that you can use that way.

However, you can create a function that contains the code
and call it from the event property. Instead of using
[Event Procedure]
in the event property, use the function this way:
=functionname()
 
Marshall's reply is the way to go. The only other way might be, to set the
form's KeyPreviw property, and code the KeyDown and KeyPress events for the
form. You could probably tell, from those events, whether the user had
pressed an "updating" key into an updatable control. But that would not
consider changes via the mouse, eg. selecting from a combo box.

HTH,
TC
 
Back
Top