Find out when calculating is done

aawsum

New member
Local time
Today, 19:27
Joined
Apr 8, 2009
Messages
7
Hi people,

One of the forms I have is calculating some fields with dlookup and dcount formula's.
This is taking a while, what means that first the form is shown, but the values stay empty until the calculations are finished.
You can see that the form is still calculating because the status bar in the bottom left corner says "calculating..."

What I want to do is tell the user that he has to be patient, and remove this message when the calculating is done.

However, I cannot figure out which event is triggered when calculating is finished. I have tried test messages in a lot of triggers, but without succes so far.

Can anybody help ?

regards
 
Have you tried the forms after update event?
 
Thanks for your quick answer

Yes I have tried the afterupdate event.
Point is that the form does not contain a recordset.
It just contains labels and textfields, and some of the fields have a formula as "control source"

so until now no luck :(
 
Is there any way you can do all of your calculations in code? That way you could open a message form when they start and close it when they're done.
 
Sure I can do that.
My objection is that there are a lot of obejcts on the form, if I do this in code, then I do not have a good overview what formula is ment for what field.

But thanks again, in my search for the ultimate answer I overlooked this obvious one ;)

But anyway, my question is really keeping me awake.
I know I can solve it with the workaround above, but I still would like to know how to capture the moment when the calculation of the form ends
 
Hum.... Is there one calulation/text box that is always the last to finish calculating?
 
If your controls have DLookups and DCounts in their control source then why not take them out and place them in a sub routine can call then in the order you want them you can use the DoCmd.Echo to say "Finished.." on the status bar.
 
Hum.... Is there one calulation/text box that is always the last to finish calculating?

yes, also a nice workaround :p
but if I add a new object on the form, then this is not valid any more..

@DCrake
Like I said, I can place everything in a subroutine.
I am just very curious why the answer to my question is so difficult, it just looks like there is no event/trigger that tells you that the form calculation is done.

Nevertheless, I really do appreciate your tips & trics, the can be real eye openers :)
 
But why would the form want to know that the calculations have finished? The form is just an interface for the data. It is up to the developer to decide if the user needs to know or not.
 
But why would the form want to know that the calculations have finished? The form is just an interface for the data. It is up to the developer to decide if the user needs to know or not.

I am not sure I get your point :confused:
I am the developer. I want to tell/show the user that calculation has finished (because he/she does not see the small status bar).

I can do this in a few ways, one is placing all formula's etc. in vba en add some code after it that shows the user its finished.
or
I can add the formula's in the record source of each control on the form, and tell the user after the form is fully loaded and finished with the calculations. The only question i have is what is the trigger that tells me the calculations are finished. I am sure access knows, because the status bar is able to show the text "calculating".

Like I said, I am aware of all workarounds, I am just looking for the answer to this last question.

regards
 
I would put all of this testing in a module (provided the tests support business rules). Then put each test in a function. Then call all of the functions in series in a procedure. This way you can call any test from anywhere and move the entire test to a new db if needed and seperate it from the form (the presentation level).
 
Ken:
That was what I was trying to get accross. Anyway if calculations take so long to perform at record level then this implies that either there is a hell of alot of calculations taking place or it could be simplified. Users should not be expected to wait seconds for calculations to take place. If they do it smacks of bad programming and can sometimes become unacceptable by the client.

I remember quite a number of years ago (20+) we were writing an app and the client cancelled the project because it took 2 seconds to open a form.

David
 

Users who are viewing this thread

Back
Top Bottom