Private Sub cmd查询_Click()
Dim frm As Form, ctl As Control
Dim vari As Variant
Dim strWhere As String
Dim str As String
Set frm = Forms!ctaa
Set ctl = frm!样本编码
For Each vari In ctl.ItemsSelected
strWhere = "样本编码='" & ctl.ItemData(vari) & " '" & str
str = "Or" & " " & strWhere
Next
Me.aa_查询1_子窗体.Form.Filter = strWhere
Me.aa_查询1_子窗体.Form.FilterOn = True
Me.aa_查询1_子窗体.Requery
End Sub