If Not IsNull(Me.Combo1) Then
'有输入
strWhere = strWhere & "([罐名称] like '*" & Me.Combo1 & "*') AND "
End If
If Not IsNull(Me.Combo2) Then
'有输入
strWhere = strWhere & "([架名称] like '*" & Me.Combo2 & "*') AND "
End If
If Not IsNull(Me.Combo3) Then
'有输入
strWhere = strWhere & "([层名称] like '*" & Me.Combo3 & "*') AND "
End If
Set Rst = CurrentDb().OpenRecordset("SELECT * From 冻存管") Rst.Filter = strWhere Do While Not Rst.EOF
On Error Resume Next
Controls("Label" & (Rst!孔ID)).Tag = "True"
If Controls("Label" & (Rst!孔ID)).Caption <> "层名称:" & Rst!层名称 & vbNewLine & "内容:" & Rst!内容 & _
vbNewLine & "名称:" & Rst!名称 Then
Controls("Label" & (Rst!孔ID)).Caption = ""
Controls("Label" & (Rst!孔ID)).Caption = "层名称:" & Rst!层名称 & vbNewLine & "内容:" & Rst!内容 & _
vbNewLine & "名称:" & Rst!名称
End If
Rst.MoveNext
Loop
End Sub[attach]23719[/attach]
[attach]23720[/attach]