Find record field

davesmith202

Employee of Access World
Local time
Today, 07:56
Joined
Jul 20, 2001
Messages
522
I have a field in the header called SearchByJobNo. I want to click in there type in the Job No and it will search on the Job No field when I hit enter. Unfortunately, the Job No field is not unique. So when you hit it again, it should then go to the next record with the same Job No.

Any easy way to do this, with a combo box in the header?

They currently use the Find button but I want to cut down the steps and use a search field.

Thanks,

Dave
 
I think you need something like "DemoSearchNextA2000.mdb" (attachment, zip).
Look at Table, forms, (VBA). Open Form1 and try.
Adapt it in your mdb.
 

Attachments

Thanks for that. I had a look but I'm still struggling. I've tried this code that is triggered by the afterupdate event.

Code:
Private Sub SearchByJobNo_AfterUpdate()

strCriteria = CLng(Me.SearchByJobNo)

If strCriteria = "" Then
   MsgBox "You have to populate GovenName and Surname first?!", vbOKOnly
   Exit Sub
End If
Set rst = Me.RecordsetClone
rst.FindNext strCriteria
If rst.NoMatch Then
   MsgBox "No more!"
Else
   Me.Bookmark = rst.Bookmark
End If

End Sub
 
Last edited:
Send a short example of your mdb, (Access 2000 or 2002-2003).
 

Users who are viewing this thread

Back
Top Bottom