代码这样写
Dim Filter As String = "1=1"
Dim myfs As winForm.TextBox=e.Form.Controls("贸易方式")
If myfs.Value IsNot Nothing Then
Filter &= " and 贸易方式='"& myfs.Value &"'"
End If
Dim khmc As winForm.TextBox=e.Form.Controls("客户名称")
If khmc.Value IsNot Nothing Then
Filter &=" and 客户名称='"& khmc.Value &"'"
End If
Dim khzh As winForm.TextBox=e.Form.Controls("客户账户")
If khzh.Value IsNot Nothing Then
Filter &=" and 客户账户='"& khzh.Value &"'"
End If
Dim hth As winForm.TextBox=e.Form.Controls("合同号")
If hth.Value IsNot Nothing Then
Filter &= " and 合同号='"& hth.Value &"'"
End If
Tables("记录表").Filter=Filter