希望:用的sql数据源。A电脑增加行后,B电脑也能加载出来。
Dim Filter As String
Dim dtp1 As Date
dtp1 = e.Form. Controls("DateTimePicker1").Value
If e.Form. Controls("DateTimePicker1").Value Is Nothing
Messagebox.show("请输入派工日期!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
'Dim Filter As String
With e.Form.Controls("ComboBox1")
If .Value IsNot Nothing Then
Filter = Filter & "时间 like '%" & .Value & "%'"
End If
End With
With e.Form.Controls("cmbProduct")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "部门 like '%" & .Value & "%'"
End If
End With
With e.Form.Controls("ComboBox2")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "合同状态 Like '%" & .Value & "%'"
End If
End With
With e.Form.Controls("DateTimePicker1")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "截止日期 >= '" & .Value & "'"
End If
End With
With e.Form.Controls("DateTimePicker1")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "截止日期 <= '" & .Value & "'"
End If
End With
If Filter > "" Then
DataTables("派工_Table1").LoadFilter = Filter
DataTables("派工_Table1").Load()
End If
Dim id As Integer = DataTables("派工").Compute("Max(_Identify)")
Dim Filter1 As String = "[_Identify] > " & id
DataTables("派工").AppendLoad(Filter1, False)
Tables("派工_Table1").Filter = Filter & " and (交单 is null or 交单 not like '%取消%')"
Tables("派工_Table1").Sort = "时间"
[此贴子已经被作者于2018/11/21 22:16:18编辑过]