aa数组存放的是变量值,不是变量名称。
比如
Dim aa(59) As object
aa(0) = wr
aa(1) = tcjgz
所以只能在对应的变量计算有值后再给数组赋值,比如
'其他费用
Dim tcjgz0 As Double=DataTables("fyb").Compute("Sum(金额)","[日期]>= #" & dt1 & "# and [日期]<= #" & dt2 & "# and [二级代码]='a010'") '车间工资
Dim tcjgz1 As Double=tcjgz0*tzb1
Dim tcjgz2 As Double=tcjgz0*tzb2
Dim tcjgz As Double=tcjgz1+tcjgz2
aa(1) = tcjgz ‘给数组赋值代码应该放到这里’
又比如
Dim dt5 As New Date(y1,j,1)
Dim dt6 As New Date(y1,j,Date.DaysInMonth(y1,j))
For Each wr As DataRow In DataTables("选客户综合数据逐月计算表").DataRows
aa(0) = wr
Functions.Execute("运算函数1",aa) '''
Next
[此贴子已经被作者于2022/3/3 10:04:34编辑过]