Access 2003, record set clone for name

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

Guest

I need help in making a name text box, useing record set clone. so when user
types a name all data for that name loads
 
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
 
Back
Top