Finding a Record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to find a specific record in a form. Can you tell me the steps
to get that accomplished? Thanks!
 
How do you want to do that?
This sample of code will take a value entered in a text box, and look in a
specific field if that value exist, and if it does it will move to that record

Private Sub Search_Click()
Dim mytable As Recordset
Dim Criteria As String
Dim FormMark

Criteria = "[Field Name in the table] = '" & Me.[StringFieldInTheForm] &
"'"
Set mytable = Me.RecordsetClone
mytable.FindFirst Criteria
If mytable.NoMatch Then
MsgBox "No Match"
Else
FormMark = mytable.Bookmark
Me.Bookmark = FormMark
Me.[StringFieldInTheForm].SetFocus
End If
End Sub
 
Hi, Sabrina.

Tom Wickerath wrote an easy, step-by-step tutorial on how to create a combo
box on your form that, when an item is selected, will display the correct
record. Please see the following Web page for a link to Tom's article,
"Using a Combo Box to Find a Record":

http://www.Access.QBuilt.com/html/articles.html

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 
I should rephrase my question. I am working on this problem and the
following is to be done:

I have to use the AutoForm: Columnar Wizard to create a form from a table.
I am to have opened up the Microsoft Access Help task pane and I had to type
in "find a specific record in a form." From that question, I had to select
the topic "Find a record in a datasheet or form." The topic I had to choose
relating to finding a record by record number. I did this and could not find
some of these in the Access Help Task Pane. This is what I need help with.
Thank you.
 
The topic I had to choose
relating to finding a record by record number. I did this and could not find
some of these in the Access Help Task Pane. This is what I need help with.

From Access 2003 Help Task Pane:

"Find a record by record number in a datasheet or form

"Open a table, query, form, view, or stored procedure in Datasheet view, or
a form in Form view.

"Double-click the number in the record number box to select it, or press F5.
Type the number of the record you want, and then press ENTER."

Is this what was missing?

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 
Yes...Thank you!

'69 Camaro said:
From Access 2003 Help Task Pane:

"Find a record by record number in a datasheet or form

"Open a table, query, form, view, or stored procedure in Datasheet view, or
a form in Form view.

"Double-click the number in the record number box to select it, or press F5.
Type the number of the record you want, and then press ENTER."

Is this what was missing?

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 
Back
Top