根据上次的成功的统计求和代码如下:
For i = 1 To 9
s = "Select Sum([j(" & i & ")]) from fl2 where [z(" & i & ")]='银行存款' GROUP BY [Z(" & i & ")]"
If conn.Execute(s).EOF = False And IsNull(conn.Execute(s)(0)) = False Then
a = a + conn.Execute(s)(0)
End If
Next
修改为,全部罗列输出打印出来!
Private Sub Command1_Click()
Dim i2, a2 As Single
Dim s2 As Long
For i2 = 1 To 9
s2 = "Select ([j(" & i2 & ")]) from fl2 where [z(" & i2 & ")]='银行存款'"
Print s2
Next
End Sub
执行后,出现:
“实时错误 " 13 " ”
类型不匹配!
黄条指向:
s2 = "Select ([j(" & i2 & ")]) from fl2 where [z(" & i2 & ")]='银行存款'"