Eljefegeneo
Still trying to learn
- Local time
- Today, 07:26
- Joined
- Jan 10, 2011
- Messages
- 904
I have the following code to search for a record based on its record number. What I want to do is modify the code so that if a certain number is not found I want to open the next sequential record. I.e. if record number 80 is not found, then open the next record in sequence which may be 85. (I am using late binding)
Code:
Dim lngPK As Long
lngPK = Me.NumberID
Me.Requery
Me.FilterOn = False
With Me.RecordsetClone
.FindFirst "ID = " & lngPK
If .NoMatch Then
MsgBox "Record not found!", vbCritical
Else
Me.Bookmark = .Bookmark
End If
End With