search command

G

Guest

Hello,

I found this in August of 2005 postings.
Is there anyway to make the below code into a wildcard search also ??
___________________________________________________________________

Subject: Re: Making a command button to search 8/23/2005 10:56 AM PST

By: Rick Brandt In: microsoft.public.access.modulesdaovba

I am trying to make a command button on one of my forms that will
search for a particular person in my table using last name

Assuming that your form has a field named [LastName]...

Dim RetVal as String
RetVal = InputBox("Enter Last Name")

If RetVal <> "" Then
Me.Filter = "[LastName] = '" & RetVal & "'"
Me.FilterOn = True
End If
 
M

[MVP] S.Clark

Me.Filter = "[LastName] Like '*" & RetVal & "*'"

--
Steve Clark, Access MVP
FMS, Inc
http://www.fmsinc.com/consulting
Professional Access Database Repair
*FREE* Access Tips: http://www.fmsinc.com/free/tips.html

Tall Mary said:
Hello,

I found this in August of 2005 postings.
Is there anyway to make the below code into a wildcard search also ??
___________________________________________________________________

Subject: Re: Making a command button to search 8/23/2005 10:56 AM PST

By: Rick Brandt In: microsoft.public.access.modulesdaovba

I am trying to make a command button on one of my forms that will
search for a particular person in my table using last name

Assuming that your form has a field named [LastName]...

Dim RetVal as String
RetVal = InputBox("Enter Last Name")

If RetVal <> "" Then
Me.Filter = "[LastName] = '" & RetVal & "'"
Me.FilterOn = True
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top