Good afternoon everyone,
Access is really frustrating me today. It was working the way I wanted it... then magically it stopped and is giving me errors. I'm trying to setup an advanced search form. In the form header I have unbound text fields for the user to input criteria. After they input the criteria, the idea is to apply a filter to the data below based on what they identified. It worked the first time I tried it, now I get a compiling error "label not defined". Here's the code:
Code:
Private Sub SearchButton_Click()
On Error GoTo Err_SearchButton_Click
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "CONVERT_LNAME LIKE '" & Me![Text16] & "*" & "'" And "CONVERT_FNAME LIKE '" & Me![Text18] & "*" & "'" And "RABBI_LNAME LIKE '" & Me![Text20] & "*" & "'" And "RABBI_FNAME LIKE '" & Me![Text22] & "*" & "'" And "PLACE LIKE '" & Me![Text24] & "*" & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
DoCmd.ApplyFilter , "CONVERT_LNAME LIKE '" & Me![Text16] & "*" & "'" And "CONVERT_FNAME LIKE '" & Me![Text18] & "*" & "'" And "RABBI_LNAME LIKE '" & Me![Text20] & "*" & "'" And "RABBI_FNAME LIKE '" & Me![Text22] & "*" & "'" And "PLACE LIKE '" & Me![Text24] & "*" & "'"
End Sub
Debugger highlights the first line. SearchButton is indeed the name of the object. I'm at a lost and am going crazy on this one. Especially since Access teased my by functioning the first time I tired it. I did delete the original button, but coped the code over and renamed the object.
Any suggestions?
Thanks!
Nathan