E
Eliezer
I have a bunch of tables with fields named something to the
effect of ABC1, ABC2, ABC3, etc.. I have to add the values
of all those together. The way it is currently being done
is basically
Dim rst As New ADODB.Recordset
TOTAL = TOTAL + rst!ABC1
TOTAL = TOTAL + rst!ABC2
....
TOTAL = TOTAL + rst!ABC46
rst!TOTAL = TOTAL
I was wondering if I could use a for loop, as such:
Dim CURRREC as String
For n = 1 To 46 Step 1
CURRREC = "ABC" + n
TOTAL = TOTAL + rst!CURRREC
Next n
(please correct me if my syntax is incorrect; I'm not
trained to be a VBA programmer.) Would this idea work? I
would think not; it seems that it would look for CURRREC ni
the table. How would I get it to recognize that CURRREC is
a variable? Thanks!
effect of ABC1, ABC2, ABC3, etc.. I have to add the values
of all those together. The way it is currently being done
is basically
Dim rst As New ADODB.Recordset
TOTAL = TOTAL + rst!ABC1
TOTAL = TOTAL + rst!ABC2
....
TOTAL = TOTAL + rst!ABC46
rst!TOTAL = TOTAL
I was wondering if I could use a for loop, as such:
Dim CURRREC as String
For n = 1 To 46 Step 1
CURRREC = "ABC" + n
TOTAL = TOTAL + rst!CURRREC
Next n
(please correct me if my syntax is incorrect; I'm not
trained to be a VBA programmer.) Would this idea work? I
would think not; it seems that it would look for CURRREC ni
the table. How would I get it to recognize that CURRREC is
a variable? Thanks!