{:soso_e127:}
Private Sub 查询_Click()
On Error GoTo Err_查询_Click
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.员工ID) Then
strWhere = strWhere & "([员工ID] like '*" & Me.员工ID & "*') AND "
End If
If Not IsNull(Me.名称) Then
trWhere = 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
If Not IsNull(Me.开始日期) Then
strWhere = strWhere & "([销售日期] >= #" & Format(Me.开始日期, "yyyy-mm-dd") & "#) AND "
End If
If Not IsNull(Me.结束日期) Then
strWhere = strWhere & "([销售日期] <= #" & Format(Me.结束日期, "yyyy-mm-dd") & "#) AND "
End If
If Len(strWhere) > 0 Then
strWhere = Left(strWhere, Len(strWhere) - 5)
End If