Use the After Update event to move to the desired record.
This example assumes an unbound text box named "txtFindBoxID" where the user
enters the number to find:
Private Sub txtFindBoxID_AfterUpdate()
Dim strWhere as String
If Not IsNull(Me.txtFindBoxID) Then
If Me.Dirty Then 'Save first.
Me.Dirty = False
End If
strWhere = "[BoxID] = " & Me.txtFindBoxID
With Me.RecordsetClone
.FindFirst strWhere
If .NoMatch Then
Msgbox "Not found."
Else
Me.Bookmark = .Bookmark
End If
End With
End If
End Sub
Note: If "BoxID" is a field of type Text, you need extra quotes:
strWhere = "[BoxID] = """ & Me.txtFindBoxID & """"
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Rampar" <ke*@keyimages.com> wrote in message
news:TGXub.252461$Tr4.783095@attbi_s03...
I have a table with information on mailboxes. The fields are:
BoxID
BoxSize
KeysIssued
KeysOnHand
Status
LockLastChanged
I have a wizard created form with info from the boxes table.
I want to have a text box on the form in which the person can type in the
boxid they want to go to to retrieve information without having to use the
find record button or menu option.