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 错在哪里