View Full Version : help with totals for count text boxes


gacapp
07-21-2009, 07:19 AM
I have a report that has 5 text boxes that has controlsource count formulas like this:

=DCount("*","Age Group: New-Child <1")

these count boxes work fine. The five count boxes have counts of (5,3,4,2,5). The names of the text boxes are Text19, Text20, Text21, etc.

What I need is a text box that will give me the total of those 5 count boxes. So the number in the text box should be 19.

Someone suggested to use:

=Me.Text19+Me.Text20, etc

However this did not work.

Any ideas of how I can create a text box that that total count text boxes?

Any help would be appreciated

pbaldy
07-21-2009, 07:21 AM
I assume that's not really your formula. How about another DCount with no criteria?

gacapp
07-21-2009, 08:18 AM
the formula in one of my count text boxes is:
=DCount("*","Age Group: New-Child <1")

which takes from the query "Age Group: New-Child <1"

The names on the count text boxes are: Text19, Text20, Text21, Text22 and Text23

How someone said that to get the total of all five count boxes above that I should use the following formula:

=Me.Text19 + Me.Text20 + Me. Text21 + Me.Text22 + Me.Text23

That did not work.

So can you help me with this??

pbaldy
07-21-2009, 08:28 AM
I'm surprised that works without being bracketed. "Me" is invalid outside VBA. Try

=Text19 +Text20 + Text21 + Text22 + Text23