I'm a beginner and I am trying to do the following:
I have a textbox labeled SearchField and a button labeled search
On the on click event of the search the following code runs:
Private Sub Search_Click()
Me.Form.RecordsetClone.FindNext "PN LIKE '*" & Me.SearchField.Value & "*'"
If Not Me.Form.RecordsetClone.NoMatch Then
Me.Form.Bookmark = Me.Form.RecordsetClone.Bookmark
Else
MsgBox "Part number not found"
End If
End Sub
The problem with this code is that once it gets to the last record and you click search again it says "Part number not found"
What i want to do is check to see if it is on the last record, if so then use FindFirst else use FindNext
Any idea's?
Thanks,
-Saint
I have a textbox labeled SearchField and a button labeled search
On the on click event of the search the following code runs:
Private Sub Search_Click()
Me.Form.RecordsetClone.FindNext "PN LIKE '*" & Me.SearchField.Value & "*'"
If Not Me.Form.RecordsetClone.NoMatch Then
Me.Form.Bookmark = Me.Form.RecordsetClone.Bookmark
Else
MsgBox "Part number not found"
End If
End Sub
The problem with this code is that once it gets to the last record and you click search again it says "Part number not found"
What i want to do is check to see if it is on the last record, if so then use FindFirst else use FindNext
Any idea's?
Thanks,
-Saint