Bob, I was able to get the code to work, almost. When executing it would output to a table and to a list box and included all of the combo box selections. But it will not count correctly. The only thing I changed in the code was the column names and the table as shown below.
strSQL = "SELECT CF1, CF2, CF3, CF4, CF5, CF6, CF7, CF8, CF9, CF10 FROM MainTable"
If the columns are populated like this with the rest of the fields blank:
MainTable
CF1 CF2 CF3 CF4 CF5 CF6
A B C D E F
G H I J K L
M N O P Q R
S T U V W X
Y Z AA BB CC DD
I would get this result:
tblOptionCounts
OptionName OptionCount
A 1
B 1
C 1
D 1
E 1
F 5
G 1
H 1
I 1
J 1
K 1
L 5
M 1
N 1
O 1
P 1
Q 1
R 5
S 1
T 1
U 1
V 1
W 1
X 5
Y 1
Z 1
AA 1
BB 1
CC 1
DD 5
The count should be 1 for all of them.
If I populate the table with one field fore each of the five records like this with the rest blank:
MainTable
CF1
A
B
C
D
E
I get this result:
tblOptionCounts
OptionName OptionCount
A 10
B 10
C 10
D 10
E 10
On Friday I read about indexes and collections and still do not have any idea of what I am doing wrong.
Scott
|