Simple filter question

sailorguy

Registered User.
Local time
Yesterday, 19:12
Joined
Jan 31, 2008
Messages
48
Hi,

I have a simple form and want to search by last name. I created an unbound text (Text9) in the header, with 2 buttons (Filter and UnFilter).

The form details simply has three fields, UserID, FirstName, LastName.

I added the following code to the Filter button, but when I click on the button it pops up a field saying "Enter Parameter Value" "Me.Text9". What am I missing? I'm learning here.

Code:
Private Sub Command11_Click()
Me.Filter = "[LastName] = Me.Text9"
Me.FilterOn = True
Me.Requery
End Sub

Private Sub Command12_Click()
Me.FilterOn = False
Me.Requery
End Sub
 
Try

Me.Filter = "[LastName] = '" & Me.Text9 & "'"
 
Thank you! That did it just fine.
 

Users who are viewing this thread

Back
Top Bottom