-- 窗口的两个:ComboBox,ValueChanged发生变化后:筛选table
窗口的两个:ComboBox,ValueChanged发生变化后:筛选table
这个窗口中有两个:ComboBox,分别为:执行情况(ComboBox4),单据状态(ComboBox3)当这两个:ComboBox的:ValueChanged发生变化时,怎么,联动切换?
我现在在:单据状态(ComboBox3)的:ValueChanged写了如下代码:
Dim filter As String=""
With e.Form.Controls("ComboBox4")
If .Value <> "所有" Then
Filter = "执行情况 = \'" & .Value & "\'"
End If
End With
With e.Form.Controls("ComboBox3")
If filter > "" Then
filter = filter & " and "
End If
If .Value <> "所有" Then
Filter ="单据状态 =\'" & .Value & "\' "
End If
End With
Tables("调单采购订单_table2").Filter=filter
执行情况(ComboBox4)的:ValueChanged写了如下代码:
Dim filter As String=""
With e.Form.Controls("ComboBox3")
If .Value <> "所有" Then
Filter ="单据状态 =\'" & .Value & "\' "
End If
End With
With e.Form.Controls("ComboBox4")
If filter > "" Then
filter = filter & " and "
End If
If .Value <> "所有" Then
Filter = "执行情况 = \'" & .Value & "\'"
End If
End With
Tables("调单采购订单_table2").Filter=filter
现在做出来的效果是: 改变ComboBox3,ComboBox4的值时,只执行自己的,别管另一个ComboBox的值。
此主题相关图片如下:55.jpg
[此贴子已经被作者于2015/12/27 13:37:18编辑过]