PDA

View Full Version : loop through text box totals?



samohtwerdna
04-17-2006, 11:59 AM
I have a series of text boxes that hold $ amonts for each day they are named txtTotal1 through txtTotal37.

I would like to loop through them and total the first seven (1-7)

then

loop through them again and total the next seven (8-14)

and yep, then next seven (15-21)

you get the picture by now. The reason I have only 37 text boxes as opposed to 35 or 42 is that on any given month there is only 37 possible - which makes week 6 only two days long.

Anyway, can anyone help me set up a loop or a few loops for the above calculation?
: pray2:

Norie
04-17-2006, 01:06 PM
What type of textboxes are they?

Where will the sum go?

samohtwerdna
04-17-2006, 01:22 PM
I'm not sure what type of textboxes they are - unbound is what I think you're asking. and the totals will go into another textbox called txtWeekTotal1...

samohtwerdna
04-17-2006, 01:39 PM
could I perhaps:



Dim intCount As Integer
Dim intCounter As Integer
Dim intDayCount As Integer
Dim t As Long
Dim tmpText As String
Dim tmpText2 As String
Dim tmpTextTotal As String

Do
t = Me("txtTotal" & intCounter).Value
intCounter = intCounter + 1
Loop Until intCounter = 7
txtTotweek1.Value = t