running function whenever -anything- changes on form

samcoinc

Registered User.
Local time
Today, 05:46
Joined
Sep 26, 2001
Messages
49
I have a from that estimates a price depending on hundreds of variables. I have a button right now called calculate that runs a function I wrote that does all the calculations. What I would like to do is if anything changes on the form the function will run.

I would rather not put the function in the "afterupdate" of every control. I can't find a from event that will run every time something on the form changes. Is there?

thanks
sam
 
samcoinc said:
I have a from that estimates a price depending on hundreds of variables. I have a button right now called calculate that runs a function I wrote that does all the calculations. What I would like to do is if anything changes on the form the function will run.

I would rather not put the function in the "afterupdate" of every control. I can't find a from event that will run every time something on the form changes. Is there?

thanks
sam

put the code in the 'On_Dirty' event for the form...

HTH,
Kev
 
I am sorry I didn't post that I am using access 97. It doesn't appear to be an on_dirty event available with 97. I manual put an on_dirty event in the form code and it didn't work - I sould have known when it didn't capitalize it. Is there something similar for 97 or am I doing something wrong?


Thanks again
sam
 
I don't know as I don't have '97 so there may not be an 'On_Dirty' event - maybe someone else who uses 97 regulary can chime in... you could put the code in a module and then just call it from each afterupdate event instead of placing the same code everywhere (which I'm sure you already do)... hopefully someone with '97 will be more helpful!

HTH,
Kev
 
That is what I am doing right now. Just was wondering if there was a better way.

thanks
sam

Kevin_S said:
I don't know as I don't have '97 so there may not be an 'On_Dirty' event - maybe someone else who uses 97 regulary can chime in... you could put the code in a module and then just call it from each afterupdate event instead of placing the same code everywhere (which I'm sure you already do)... hopefully someone with '97 will be more helpful!

HTH,
Kev
 

Users who are viewing this thread

Back
Top Bottom