Is there any possibility to sum all the values in many (say n) columns in a single table using VBA in access 2003?
Say I have a table with 200 columns. Say the table name is TableCOUNT and the columns inside the table have names such as LX1, LX2,....,LX200.
If I use DSum for a single (or a few) columns giving the name of the column, everything is OK. I get a total for this (these) ciolumns:
Expand|Select|Wrap|Line Numbers
- Open "N:\FM AM\TEST_LOG1.txt" For Output As #intOutFile
- Print #intOutFile, "Printing sum of a single column LX5 in TableCOUNT table"
- curX1 = DSum("[LX5]", "TableCOUNT")
- Print.Debug curX1
- Print #intOutFile, curX1
- Close intOutFile
Expand|Select|Wrap|Line Numbers
- Open "N:\FM AM\TEST_LOG1.txt" For Output As #intOutFile
- Print #intOutFile, "Printing sum of each column in TableCOUNT table"
- For yy = 1 To 200
- curX1 = DSum(yy, "TableCOUNT")
- If curX1dif < 1 Then Print #intOutFile, "WARNING!!! All values in this Fund are ZERO"
- Print.Debug curX1
- Print #intOutFile, curX1
- Next yy
- Close intOutFile
Thanks in advance