以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  帮助看一下代码For Each dr As DataRow In DataTables("资金收付").DataRows  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=59917)

--  作者:jswjyjf
--  发布时间:2014/11/13 14:17:00
--  帮助看一下代码For Each dr As DataRow In DataTables("资金收付").DataRows
For Each dr As DataRow In DataTables("资金收付").DataRows
If "Tables(\'资金收付\').current(\'日期\')>= #" & e.Form.Controls(\'StartDate\') &"#"
Tables("往来明细帐").addnew()
End If
Next

--  作者:有点甜
--  发布时间:2014/11/13 14:25:00
--  

 你想做什么?

 

For Each dr As DataRow In DataTables("资金收付").DataRows
    If Tables("资金收付").current("日期") >= e.Form.Controls("StartDate").Text
        Tables("往来明细帐").addnew()
    End If
Next


--  作者:有点甜
--  发布时间:2014/11/13 14:26:00
--  
For Each dr As DataRow In DataTables("资金收付").DataRows
    If dr("日期") >= e.Form.Controls("StartDate").Text
        Tables("往来明细帐").addnew()
    End If
Next

--  作者:jswjyjf
--  发布时间:2014/11/13 22:05:00
--  

Dim Filter As String
With e.Form.Controls("ComboBox1")
    If .Value IsNot Nothing Then
        Filter = "毛纺厂名称= \'" & .Value & "\'"
    End If
End With
With e.Form.Controls("StartDate")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "日期 >= #" & .Value & "#"
    End If
End With
With e.Form.Controls("EndDate")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "日期 <= #" & .Value & "#"
    End If
End With

DataTables("往来明细帐").DataRows.clear
For Each dr As DataRow In DataTables("资金收付").DataRows
    If filter
        Tables("往来明细帐").addnew()
        Tables("往来明细帐").current("日期")=dr("日期")
        Tables("往来明细帐").current("单据号")=dr("单据号")
        Tables("往来明细帐").current("业务类型")=dr("单据性质")
        Tables("往来明细帐").current("借方金额")=dr("借方金额")
        Tables("往来明细帐").current("单位名称")=dr("单位名称")
        Tables("往来明细帐").current("备注")=dr("摘要")                                      
End  If
Next

 

 

 

这段代码的 if filter 错在哪里

 


--  作者:有点甜
--  发布时间:2014/11/13 22:06:00
--  
For Each dr As DataRow In DataTables("资金收付").Select(filter)
    Tables("往来明细帐").addnew()
    Tables("往来明细帐").current("日期")=dr("日期")
    Tables("往来明细帐").current("单据号")=dr("单据号")
    Tables("往来明细帐").current("业务类型")=dr("单据性质")
    Tables("往来明细帐").current("借方金额")=dr("借方金额")
    Tables("往来明细帐").current("单位名称")=dr("单位名称")
    Tables("往来明细帐").current("备注")=dr("摘要")
Next

--  作者:jswjyjf
--  发布时间:2014/11/13 22:07:00
--  

赞一个