Set DataRecordset = New ADODB.Recordset
DataRecordset.Open SqlData, m_DBConn, 1With Me.MSFlexGrid1
For i = .FixedRows To .Rows - 1
BeginDate = Format(.TextMatrix(i, 0), "yyyy-mm-dd")
EndDate = Format(.TextMatrix(i, 1), "yyyy-mm-dd")
For k = .FixedCols To .Cols - 1
ItemID = .TextMatrix(0, k)
DataRecordset.Filter = "D_ID='" & ItemID & "' and D_Date>= '" & BeginDate & "' and D_Date<'" & EndDate & "'"
Do While Not DataRecordset.EOF
.TextMatrix(i, k) = Val(.TextMatrix(i, k)) + Val(DataRecordset("人次")& "")
DataRecordset.MoveNext
Loop
Next
Next
End With
从 with开始 能帮我每行都写个注释吗?谢谢!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货