WalksWithSky
Instructor
Hello:
Working on making a custom Find feature on a form, with two buttons: one button displays in input box where the user inserts the text they wish to find (this finds the first record) the second button uses the same value inserted in the input box and acts as a find next.
The problem is this: if I search for Green, and there are 5 records with Green, it shows the 5 records, but then the button acts as a next record button -- it kicks out the search criteria after it finds all the records and becomes a next record button.
Here's the code for the second button. strSearch is a public variable (input box where user enters search words)Any help would be appreciated:
Walks With Sky
Working on making a custom Find feature on a form, with two buttons: one button displays in input box where the user inserts the text they wish to find (this finds the first record) the second button uses the same value inserted in the input box and acts as a find next.
The problem is this: if I search for Green, and there are 5 records with Green, it shows the 5 records, but then the button acts as a next record button -- it kicks out the search criteria after it finds all the records and becomes a next record button.
Here's the code for the second button. strSearch is a public variable (input box where user enters search words)Any help would be appreciated:
Code:
Private Sub Command5_Click()
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
If Len(strMyValue) > 0 Then
DoCmd.GoToRecord , , acNext
DoCmd.FindRecord strSearch, acAnywhere, , , True, acAll, False
End If
If rs.NoMatch Then
MsgBox "No Results Found"
End If
Walks With Sky