Text box control source is sum of other text boxes...

J

JimS

tb1: =dsum(.....)
tb2: =dsum(.....)

etc.

tbTot: =nz(tb1,0)+nz(tb2,0)+nz(tb3,0)....

tbTot calculates too fast. It only catches the value of tb1. Needs to
calculate last in the series, after all the rest are done. Ideas? Probably
simple. Thanks in advance.
 
J

Jeanette Cunningham

Hi JimS,
you can try using vba to get the total-->
Me.tbTot = nz(tb1,0)+nz(tb2,0)+nz(tb3,0)....

Pick a suitable event to place this code, preferably the event which causes
the values for tb1, tb2 ... to change.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
J

JimS

The event that causes those other text boxes to change is the intrinsic
recalc associated with (I assume) the OnCurrent event. Can't imagine it would
do any good to code it into the actual OnCurrent event handler (I don't have
one now....) I would assume it would be just as quick to calc, and therefore
miss the postback from the dsum calcs.

I guess I'm just going to have to make the control source equal to

=DSum(...)+DSum(...), etc.

That means I recalc all those DSums twice every time one of them is calc'd.

I don't like that.
 

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