Solved

How to move to specific record in recordset and display on form

Posted on 1998-12-17
3
928 Views
Last Modified: 2009-12-16
How can I make a specific record the current record displayed on my edit form? I want to be able to type in a criteria in text box and move to the first record found matching the criteria. I have tried this using the findfirst method to no avail. I created the form with the wizard.
0
Comment
Question by:englm
3 Comments
 
LVL 8

Accepted Solution

by:
Helicopter earned 50 total points
ID: 1971420
Try using the recordsetclone. e.g.


Me.RecordsetClone.FindFirst "[lngYourID] = " & Me![txtYourTextbox]
Me.Bookmark = Me.RecordsetClone.Bookmark

In the afterupdate event of the textbox or behind a command button.
0
 
LVL 10

Expert Comment

by:brewdog
ID: 1971421
if you used the wizard to create the form, chances are you'd have to use this syntax:

DoCmd.FindRecord [criteria]

For instance, if you were typing in a LastName text box and then clicked a button to find, you'd do this:

LastName.setfocus
DoCmd.FindRecord "LastName = '" & LastName & "'"

This pulls the value from the text box and searches for it.

brewdog
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6875716
GREETINGS!

This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.  If you are an EE Pro user, you can also choose Power Search to find all your open questions.

This is the Community Support link, if help is needed, along with the link to All Topics which reflects many TAs recently added.  Also in the Community Support link is a question on how experts can help, if they wish, on the cleaning of old and abandoned questions.

http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
http://www.experts-exchange.com/jsp/zonesAll.jsp
 
Thank you,
Moondancer
Moderator @ Experts Exchange
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

685 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