?
Solved

Find a record with an Input box

Posted on 2010-08-28
5
Medium Priority
?
413 Views
Last Modified: 2013-11-27
experts,

I am using the below but get a syntax.  Any suggestions?
Private Sub cmdFind_Click()

    Me.Recordset.FindFirst "End User" & InputBox("Enter Name")
   
End Sub
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
  • 3
  • 2
5 Comments
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 2000 total points
ID: 33550659
Try this:



    Me.Recordset.FindFirst "[End User] =" & Chr(34) &  InputBox("Enter Name") & Chr(34)

mx
0
 

Author Comment

by:pdvsa
ID: 33550677
OK that works.  Can you add a "like" into that?  I wonder how this code addresses the fact that there could be two or more records if i use a "like"?  I assume it would go to the first one but then not sure about the second one.  Do you have an idea about that or maybe I should go about it another way.  

thank you
0
 
LVL 75
ID: 33550728
" I assume it would go to the first one but then not sure about the second one."
As is, it's just going to find the first occurrence in the Recordset.

Well, using Like is a different paradigm.  You will have to decide what to do - if anything - with additional occurrences ... or something that is only a partial hit ... ala Like "ABC" ....

mx
0
 

Author Comment

by:pdvsa
ID: 33550761
OK. Well I think I need to rephrase this question.  I will close it out as you have provided an answer.   I will ask another that requests to handle multiple occurences and see what happens.  I do need to handle multiple occurrences for "like".  

thank you mx
0
 
LVL 75
ID: 33550771
You are welcome.

Yes ... decide "*how* ... you want to handle multiple occurrences first ....

mx
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Suggested Courses

801 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