Private Sub 查询_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.材料名称) Then
strWhere = strWhere & "([材料名称] like '*" & Me.材料名称 & "*') AND "
End If
If Not IsNull(Me.数量) Then
strWhere = strWhere & "([数量] like '*" & Me.数量 & "*') AND "
End If
If Len(strWhere) > 0 Then
strWhere = Left(strWhere, Len(strWhere) - 5)
End If
Me.[入库表].Form.Filter = strWhere
Me.[入库表].Form.FilterOn = True
End Sub
Private Sub 清除_Click()
Dim ctl As Control
For Each ctl In Me.Controls
Select Case ctl.ControlType
Case 材料名称
If ctl.Locked = False Then ctl.Value = Null
Case acComboBox
ctl.Value = Null
End Select
Next
Me.[入库表].Form.Filter = ""
Me.[入库表].Form.FilterOn = False
Me.Refresh
Me.入库日期 = Null
Me.客户名称 = Null
Me.材料名称 = Null
Me.数量 = Null
End Sub