With DataTables ("汇总表") .StopRedraw '静止绘制 For Each DR In DataTables("流水账").select(“科目表_一级=‘“ & t1 & ”’”) Dim dr2 As DataRow dr2 = DataTables ("汇总表").AddNew dr2("一级科目") = dr("科目表_一级") dr2("日期") = dr("日期") dr2("摘要") = dr("摘要") dr2("凭证号") = dr("凭证号") dr2("借方") = dr("科目表_借方") dr2("贷方") = dr("科目表_贷方") next For Each DR In DataTables("流水账").select(“对方科目_一级=‘“ & t1 & ”’”)
Dim dr2 As DataRow
dr2 = DataTables ("汇总表").AddNew
dr2("一级科目") = dr("对方科目_一级")
dr2("日期") = dr("日期")
dr2("摘要") = dr("摘要")
dr2("凭证号") = dr("凭证号")
dr2("借方") = dr("对方科目_借方")
dr2("贷方") = dr("对方科目_贷方")
Next
.ResumeRedraw
End With
如果是SqlServer,另外可以看看:http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&Id=147288