Dim strWhere As String '定义条件字符串
strWhere = "" '设定初始值-空字符串
If Not IsNull(Me.供应商) Then
'有输入
strWhere = strWhere & "([供应商] like '*" & Me.供应商 & "*') AND"
End If
'判断【经营项目】条件是否有输入的值
If Not IsNull(Me.经营项目) Then
'有输入
strWhere = strWhere & "([经营项目] like '" & Me.经营项目 & "') AND "
End If
'判断【类别】条件是否有输入的值
If Not IsNull(Me.类别) Then
'有输入
strWhere = strWhere & "([类别] like '" & Me.类别 & "') AND "
End If
'判断【联系人】条件是否有输入的值
If Not IsNull(Me.联系人) Then
'有输入
strWhere = strWhere & "([联系人] like '" & Me.联系人 & "') AND "
End If