Private Sub cmd_Select_Click()
Dim strWhere1, strWhere2 As String
strWhere1 = ""
strWhere2 = ""
If Not IsNull(Me.销售订单号) Then
strWhere1 = strWhere1 & "销售订单号 like '*" & Me.销售订单号 & "*' and "
strWhere2 = strWhere2 & "销售订单号 like '*" & Me.销售订单号 & "*' and "
End If
If Not IsNull(Me.客户) Then strWhere1 = strWhere1 & "客户 like '*" & Me.客户 & "*' and "
If Not IsNull(Me.商品) Then strWhere2 = strWhere2 & "商品 like '*" & Me.商品 & "*' and "
If Len(strWhere1) > 0 Then strWhere1 = Left(strWhere1, Len(strWhere1) - 5)
If Len(strWhere2) > 0 Then strWhere2 = Left(strWhere2, Len(strWhere2) - 5)
Me.frmChild1.Form.Filter = strWhere1
Me.frmChild1.Form.FilterOn = True
Me.frmChild2.Form.Filter = strWhere2
Me.frmChild2.Form.FilterOn = True
End Sub
Dim strWhere1, strWhere2 As String
strWhere1 = ""
strWhere2 = ""
If Not IsNull(Me.销售订单号) Then
strWhere1 = strWhere1 & "销售订单号 like '*" & Me.销售订单号 & "*' and "
strWhere2 = strWhere2 & "销售订单号 like '*" & Me.销售订单号 & "*' and "
End If
If Not IsNull(Me.客户) Then strWhere1 = strWhere1 & "客户 like '*" & Me.客户 & "*' and "
If Not IsNull(Me.商品) Then strWhere2 = strWhere2 & "商品 like '*" & Me.商品 & "*' and "
If Len(strWhere1) > 0 Then strWhere1 = Left(strWhere1, Len(strWhere1) - 5)
If Len(strWhere2) > 0 Then strWhere2 = Left(strWhere2, Len(strWhere2) - 5)
Me.frmChild1.Form.Filter = strWhere1
Me.frmChild1.Form.FilterOn = True
Me.frmChild2.Form.Filter = strWhere2
Me.frmChild2.Form.FilterOn = True
End Sub