日图号是TextBox控件,还有两个类似的控件,及日工序序号和日工艺序号,都是绑定到日报表,并且日报表也有窗口Tables,是非副本类型绑定表,3个控件的TextChanged代码都是:
Dim Filter As String
With e.Form.Controls("日图号")
If .Value IsNot Nothing Then
Filter = "图号 = '" & .Value & "'"
Tables("产品目录").Filter = Filter '筛选
End If
End With
With e.Form.Controls("日工序序号")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "工序_序号 = '" & .Value & "'"
End If
End With
With e.Form.Controls("日工艺序号")
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 '筛选
Tables("审核工时_Table3").Filter = Filter '筛选
End If
改了以后有几次没有提示,我还以为搞定了,后来又出现提示了
[此贴子已经被作者于2010-4-6 18:20:51编辑过]