Dim Filter As String With e.Form.Controls("cmbProduct") If .Value IsNot Nothing Then Filter = 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 If Filter > "" Then Tables("冲压车间工资表").Filter = Filter '设置筛选条件 Dim t As Table = Tables("冲压车间工资表") Dim g As Subtotalgroup t.SubtotalGroups.Clear() t.GroupAboveData = False t.TreeVisible = False t.SpillNode = False Tables("冲压车间工资表").AutoAddNew = True If Tables("冲压车间工资表").Rows.Count = 0 Then Tables("冲压车间工资表").AddNew(50) Else With Tables("冲压车间工资表") .DataTable.DeleteFor("日期 is null") If .Rows(.Rows.Count - 1).IsNull("日期") = False Then .AddNew() End If End With End If Else Tables("冲压车间工资表").Filter = "1=2" End If
|