Solved

Find a record with an Input box

Posted on 2010-08-28
5
355 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
  • 3
  • 2
5 Comments
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Access MVP) earned 500 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now