there is a recordset with name and address. name is primary key. I have to update some one address to his new address. How can i set cursor to the exact record without searching in all the records? I used while loop to set cursor. But it is very slow.

This is my code
Code:
recordset.movefirst
Do While Not recordset.EOF
                If recordset.Fields(0).Value = txtName Then
                    recordset.Fields(1).Value = txtNewAddress
                    Exit Do
                End If
                recordset.MoveNext
 Loop

Last edited by shabbir; 4May2007 at 13:37.. Reason: Code block