Solved

Find a record with an Input box using LIke

Posted on 2010-08-28
7
452 Views
Last Modified: 2013-11-28
Experts, I need to first modify the below to handle "Like".  I also would like to know how to properly handle >1 record using the "Like".  It would be best to be able to hit "Next" or something like that to see the next record when using Like.  I am assuming this type of issue has been dealt with and someone can give me some code fot it.

thank you

Me.Recordset.FindFirst "[End User] =" & Chr(34) &  InputBox("Enter Name") & Chr(34)
0
Comment
Question by:pdvsa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 92

Expert Comment

by:Patrick Matthews
ID: 33550904
To get the Like working:Me.Recordset.FindFirst "[End User] Like '*" & InputBox("Enter Name") & "*'"That is a "contains" match.  For "begins with":Me.Recordset.FindFirst "[End User] Like '" & InputBox("Enter Name") & "*'"For "ends with":Me.Recordset.FindFirst "[End User] Like '*" & InputBox("Enter Name") & "'"
0
 

Author Comment

by:pdvsa
ID: 33550953
Ok.   How does it handle >1 match?
0
 
LVL 92

Expert Comment

by:Patrick Matthews
ID: 33551121
What are you trying to do?  FindNext is all about finding *a* record, not multiple records...
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

Author Comment

by:pdvsa
ID: 33551405
Matthews, i am trying to find all records with a msgbox.   I think that "like" would be a start but not sure if i am on the right track.  

Is this Find Next:
  Me.Recordset.FindFirst "[End User] Like '*" & InputBox("Enter Name") & "*'"

it only finds the first record right?
0
 
LVL 6

Expert Comment

by:JVWC
ID: 33551855
A button added to a form using the wizard will create this functionality for you.
Add a button in design mode and choose "Record Navigation" and "Find Record" in the wizard.

Cheers
JC
0
 
LVL 1

Assisted Solution

by:mgoodspeed
mgoodspeed earned 50 total points
ID: 33552462
mathewspatrick has the good code.
You could set the RecordScource Property of a subform to the SQL string generated in his code to display the records, then select the one you want to modify.

Alternately, you could use a popup form if there are > 1 rows, then double-click it to navigate to the record you want
0
 
LVL 92

Accepted Solution

by:
Patrick Matthews earned 450 total points
ID: 33552743
If you want all records matching certain criteria, then instead of using FindFirst, why not simply open a recordset that will have only the records you care about?  You can then loop through that recordset to build up your MsgBox prompt.
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question