search command

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
Back
Top