> How do I know that the user had update which record and when should I do
> the calculation?? I do have controlsource for all my textbox within the
> pageframe, but how can I let the user see the immediate result of the
> calculation on the screen once they finish entering data??
You can call the recalc function in the LostFocus event of the textbox
(only the ones involved in the calculation). You can manage to calculate
the value of it *before* user entered anything and keep it as a form's
property, like this:
in form.activate
this.keepvalue=calcfn()
in textbox.lostfocus()
thisform.keepvalue=thisform.keepvalue+this.value - this.oldval
(this.oldval doesn't really exist, you have to call some other stuff to
get it)
The other thing you may want to do to speed up the operation is to
delimit the scope of scan - I've hardly found an occasion where a total
of entire table was needed. It might scope to a single document, whereas
your form probably contains some keyfield to the document, so your calc
function should
scan for keyfield=thisform.dockeyfield.value
A single document may contain anything between 0 and few hundred
records, so it's probably all already in memory, and should run
reasonably fast.