Dim dr As DataRow
Dim Filter As String '设置变量Filter,返回或设置过滤条件表达式
With e.Form.Controls("combobox1") '筛选单位,Controls引用窗口中名为cmbProduct组合框数据
If .Value IsNot Nothing Then '如果cmbProduct框不为空,则执行下面的语句
dr = DataTables("表A").Find("姓名 = '" & .Value & "'","[_Identify] Desc")
If dr IsNot Nothing Then
Filter = "[_Identify]= " & dr("_Identify") '在本表中的单位中查找
End If
If Filter > "" Then '如果筛选条件为空
Tables("表A").Filter = Filter '则不筛选
End If
End If
End With