Dim kaishi As WinForm.DateTimePicker = e.Form.Controls("DateTimePicker1")
Dim jieshu As WinForm.DateTimePicker = e.Form.Controls("DateTimePicker2")
Dim filter As String = "1=1"
If kaishi.text > "" Then
filter &= " and 接收时段 >= #" & kaishi.Text & "#"
End If
If jieshu.text > "" Then
filter &= " and 接收时段 <=#" & jieshu.Text & "#"
End If
Tables("表A").Filter = filter
DataTables("表B").DataRows.Clear
For Each dr1 As Row In Tables("表A").rows
Dim dr2 As DataRow = DataTables("表B").AddNew()
For Each dc As DataCol In DataTables("表A").DataCols
dr2(dc.Name) = dr1(dc.name)
Next
Next