Private Sub 分类_AfterUpdate()
Me.名称.Requery
Me.名称 = ""
Mynew
End Sub
Private Sub 名称_AfterUpdate()
Mynew
End Sub
Sub Mynew()
Dim str As String
str = " where true "
If Nz(Me.分类) <> "" Then
str = str & " and " & "分类 ='" & Me.分类 & "'"
End If
If Nz(Me.名称) <> "" Then
str = str & " and " & "名称 ='" & Me.名称 & "'"
End If
Me.窗体2.Form.RecordSource = "select * from 表1" & str
End Sub