Locating record in form

J

John

Hi

How can I locate a record on the current form by value of an indexed field?

Thanks

Regards
 
W

Wayne-I-M

Hi John

Create a textBox and in the AfterUpdate event put this

Private Sub TextBoxName_AfterUpdate()
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[ID_Field] = " & Str(Nz(Me![TextBoxName], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub


Change TextBoxName to what it is
Change ID_Field to what it is
 
Top