|
-
Jan 25th, 2000, 10:43 PM
#6
Junior Member
Hi steviep,
The following code works for me!
If strLastName <> "" Then
'Search forward for the CustomerID
datPrimaryRS.Recordset.Find "LAST_NAME = '" & strLastName & "'", 0, adSearchForward
'If the record isn't found, we will be at the end of the recordset.
The strLastName is just a string from a text box and this code is placed under the click area of a command button.
Jim
'So, reposition the recordset back to the record we came from and search backwards.
If datPrimaryRS.Recordset.EOF Then
datPrimaryRS.Recordset.Bookmark = mybkmark
datPrimaryRS.Recordset.Find "LAST_NAME = '" & strLastName & "'", 0, adSearchBackward
'If we don't find the record this time, it doesn't exist.
'So, reposition the recordset back to the record we came from and tell the user.
If datPrimaryRS.Recordset.BOF Then
datPrimaryRS.Recordset.Bookmark = mybkmark
MsgBox "Record Not Found"
End If
End If
End If
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|