I think you are trying to set up an unbound text box so that when the user
enters a name, the form moves to that record?
Sub txtFindName_AfterUpdate ()
Dim rs As DAO.Recordset
If Not IsNull(Me.txtFindName) Then
'Save before move.
If Me.Dirty Then
Me.Dirty = False
End If
'Search in the clone set.
Set rs = Me.RecordsetClone
rs.FindFirst "[CustomerName] = """ & _
Me.txtFindName & """"
If rs.NoMatch Then
MsgBox "Not found"
Else
'Display the found record in the form.
Me.Bookmark = rs.Bookmark
End If
Set rs = Nothing
End If
End Sub
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.