按理:j(" & h & ")")应该是个完整的符合正确语法的数组了吧?
照这样改,代码如下:
Private Sub Command2_Click()
Dim a
Dim i, h As Integer
If Not Rst.EOF() Then
For i = 1 To Rst.RecordCount
For h = 1 To 9
If IsNull(Rst("z(" & h & ")").Value) Then
If Rst.Fields("z(" & h & ")").Value = "银行存款" Then
a = a + Val(Rst.Fields("j(" & h & ")").Value)
End If
End If
Next h
Rst.MoveNext
Next i
Text4.Text = Val(a)
End If
End Sub
执行时没有出现NULL了,但结果为:0
新问题好象来了!