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
 

Ask a Question

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.

Ask a Question

Top