By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,039 Members | 1,831 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,039 IT Pros & Developers. It's quick & easy.

go to specific record from data typed in text box

P: n/a
RC
I would like to go to a specific record based on what the user types
in a text box on a form. I have a table named: Boxes in the table
there is a field named: BoxNumber a form named: BxForm and a text
box on the form named: GetNumBox
I want to type a number in the text box and then press the enter key
on the keyboard and go to the corresponding record.
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
RC wrote:
I would like to go to a specific record based on what the user types
in a text box on a form. I have a table named: Boxes in the table
there is a field named: BoxNumber a form named: BxForm and a text
box on the form named: GetNumBox
I want to type a number in the text box and then press the enter key
on the keyboard and go to the corresponding record.


In the afterupdate event you could enter a formula like this
Private Sub GetNumBox_AfterUpdate()
DIm rst As DAO.Recordset
Set rst = Me.Recordsetclone
'if box is numeric use this line
rst.FindFirst "BoxNumber = " & Me.GetBoxNum
'if box is alpha use this line
rst.FindFirst "BoxNumber = '" & Me.GetBoxNum & "'"
If not rst.noMatch then
me.bookmark = rst.bookmark
else
msgbox "Box not found"
endif
set rst = Nothing
End Sub

Nov 12 '05 #2

P: n/a
RC
rc*********@yahoo.com (RC) wrote in message news:<3c**************************@posting.google. com>...
I would like to go to a specific record based on what the user types
in a text box on a form. I have a table named: Boxes in the table
there is a field named: BoxNumber a form named: BxForm and a text
box on the form named: GetNumBox
I want to type a number in the text box and then press the enter key
on the keyboard and go to the corresponding record.

To clarify:
Table Name: "Boxes"
Table Field: "BoxNumber"
Form Name: "BxForm"
text box on the BxForm form is named: "GetNumBox"

I want the user to type the Box Number into the text box and the form
will move to the record in the "Boxes" table that has that box number
in the BoxNumber field.
I didn't supply a code sample because I couldn't find anything that
worked well enough to alter. I don't know which way to go with this.
I am using Access 2000 and 2002 (I can use either, if it matters).
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.