如何把产品名称和类别连起来查询? 代码怎么改?
麻烦
Dim cpmc As WinForm.TextBox = e.Form.Controls("产品名称")
Dim lb As WinForm.ComboBox = e.Form.Controls("类别")
Dim pz As WinForm.ComboBox = e.Form.Controls("牌子")
Dim Filter As String
With e.Form.Controls("产品名称")
If .Value IsNot Nothing Then
Filter = "产品名称 like '*" & cpmc.text & "*'"
End If
End With
With e.Form.Controls("类别")
If .Value IsNot Nothing Then
filter = "类别 ='" & lb.text & "'"
End If
End With
With e.Form.Controls("牌子")
If .Value IsNot Nothing Then
Filter = "牌子 ='" & pz.text & "'"
End If
End With
If Filter > "" Then
Tables("产品明细表").Filter = Filter
End If
If Filter > "" Then
e.Form.Controls("添加产品").Table.Filter = Filter
End If