您好,这是代码,图片不知道为什么,不能上传,是我等级未够么?
Sub Read_XS()
Dim SDate,EDate,MDCK,Filter As String
SDate = RibbonTabs("CashSys")("QDate")("SDate").Value
EDate = RibbonTabs("CashSys")("QDate")("EDate").Value
If SDate = "" Then
SDate = Date.Now.Date()
End If
If EDate = "" Then
EDate = SDate
End If
SDate = CDate(SDate & " 00:00:00")
EDate = CDate(EDate & " 23:59:59")
MDCK = RibbonTabs("CashSys")("QPara")("MDCK").Text.Trim()
If MDCK = "选择门店" Then
MessageBox.Show("请选择门店!","注意",MessageBoxButtons.OK,MessageBoxIcon.Information)
Exit Sub
End If
Filter = "SH = 'T' And RQ >= '" & SDate & "' And RQ <= '" & EDate & "'And BMMC='" & MDCK & "'"
DataTables("XSD_ZB").LoadFilter = Filter
DataTables("XSD_ZB").Load()
DataTables("XTD_ZB").LoadFilter = Filter
DataTables("XTD_ZB").Load()
'Exit Sub
MainTable = Tables("XSTJ")
DataTables("XSTJ").StopRedraw
DataTables("XSTJ").DataRows.Clear()
Dim f As New Filler
f.SourceTable = DataTables("XSD_ZB") '指定数据来源
f.SourceCols = "ID,RQ,DWBM,DWMC,BMMC,JBRMC,ZDR,SHR,ZDZK,ZSL,ZJE,TJE,WJS,ZZK,ZCB,ZML,MLL,BZ,SS,XJ,SK,CK,WX,ZFB" '指定数据来源列
f.DataTable = DataTables("XSTJ") '指定数据接收表
f.DataCols = "ID,RQ,DWBM,DWMC,BMMC,JBRMC,ZDR,SHR,ZDZK,ZSL,ZJE,TJE,WJS,ZZK,ZCB,ZML,MLL,BZ,SS,XJ,SK,CK,WX,ZFB" '指定数据接收列
f.Fill() '填充数据
f.SourceTable = DataTables("XTD_ZB") '指定数据来源
f.SourceCols = "ID,RQ,DWBM,DWMC,BMMC,JBRMC,ZDR,SHR,ZDZK,ZSL,ZJE,TJE,WJS,ZZK,ZCB,ZML,MLL,BZ,SS,XJ,SK,CK,WX,ZFB" '指定数据来源列
f.DataTable = DataTables("XSTJ") '指定数据接收表
f.DataCols = "ID,RQ,DWBM,DWMC,BMMC,JBRMC,ZDR,SHR,ZDZK,ZSL,ZJE,TJE,WJS,ZZK,ZCB,ZML,MLL,BZ,SS,XJ,SK,CK,WX,ZFB" '指定数据接收列
f.Fill() '填充数据
Tables("XSTJ").Sort = "RQ"
DataTables("XSTJ").ResumeRedraw
End Sub