Dim y As Integer = Date.Today.Year
Dim dt1 As New Date(y, 1, 1)
Dim dt2 As New Date(y, 12, 31)
Dim Filter As String
Dim s As String
s =user.name
Select Case User.Group
Case "销售经理"
Dim dr1 As DataRow = Tables("订单").Current.DataRow
Dim dr2 As DataRow
dr2 = DataTables("用户").Find("[录入者] = '" & dr1(" s") & "'And [分组] = '" & dr1("分组") & "'")
Case "销售主管A", "销售主管B", "销售主管C", "销售主管D"
Dim dr1 As DataRow = Tables("订单").Current.DataRow
Dim dr2 As DataRow
dr2 = DataTables("用户").Find("[录入者] = '" & dr1(" s") & "'And [分组] = '" & dr1("分组") & "'")
Case "录入者"
s =user.name
End Select
Filter = "日期 >= #" & dt1 & "# And 日期 <= #" & dt2 & "# and 录入者 in('" & s.replace(",","','") & "')"
DataTables("订单").LoadFilter = Filter
DataTables("订单").Load()
没报错,但没加载