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

  • Thread starter Rajesh B. Patel
  • 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
 
T

tina

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.
 
M

Marshall Barton

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()
 
T

TC

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top