Find Record

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

Guest

I need some guidance in how I can find a record from a table and to be able
to edit values.

My scenario is that I want to use a combo box to find the desired record. On
selection, it will go to that record, display the information in a form and
allow me to edit the values. How would I be able to acheive this?
 
Hi, Ken.

Please see the following Web page for a link to Tom's Wickerath's
step-by-step tutorial, "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.
 
This was indeed helpful but, I ran into a snag. In the example, pkEmployerID
is a text. However, my search record (TripNumber) is an autonumber. What
syntax should I use.

See example used...

rs.FindFirst "[pkEmployerID] = '" & Me![cboFindRecord] & "'"

mind would appear like this

rs.FindFirst "[tripnumber] = '" & Me![cboFindRecord] & "'"

However, this causes a data mismatch as Tripnumber is defined as autonumber.

Ken
 
Hi, Ken.
What
syntax should I use.

Since it's not a text string, you don't need to delimit the value with
quotes. Therefore, try:

rs.FindFirst "[tripnumber] = " & Me![cboFindRecord]

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.


Ken said:
This was indeed helpful but, I ran into a snag. In the example, pkEmployerID
is a text. However, my search record (TripNumber) is an autonumber. What
syntax should I use.

See example used...

rs.FindFirst "[pkEmployerID] = '" & Me![cboFindRecord] & "'"

mind would appear like this

rs.FindFirst "[tripnumber] = '" & Me![cboFindRecord] & "'"

However, this causes a data mismatch as Tripnumber is defined as autonumber.

Ken


'69 Camaro said:
Hi, Ken.

Please see the following Web page for a link to Tom's Wickerath's
step-by-step tutorial, "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.
 
That solved it.... Thanks

'69 Camaro said:
Hi, Ken.
What
syntax should I use.

Since it's not a text string, you don't need to delimit the value with
quotes. Therefore, try:

rs.FindFirst "[tripnumber] = " & Me![cboFindRecord]

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.


Ken said:
This was indeed helpful but, I ran into a snag. In the example, pkEmployerID
is a text. However, my search record (TripNumber) is an autonumber. What
syntax should I use.

See example used...

rs.FindFirst "[pkEmployerID] = '" & Me![cboFindRecord] & "'"

mind would appear like this

rs.FindFirst "[tripnumber] = '" & Me![cboFindRecord] & "'"

However, this causes a data mismatch as Tripnumber is defined as autonumber.

Ken


'69 Camaro said:
Hi, Ken.

Please see the following Web page for a link to Tom's Wickerath's
step-by-step tutorial, "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 need some guidance in how I can find a record from a table and to be able
to edit values.

My scenario is that I want to use a combo box to find the desired record. On
selection, it will go to that record, display the information in a form and
allow me to edit the values. How would I be able to acheive this?
 
Back
Top