Gina, John,
I have several hundred record who's name field is in the "LastName,
FirstName" format such as
Brown, Tom K.
Cassins, David J.
I'm trying to do a search on the last name part then use bookmark to bring
up the record, but the code I have keeps giving me errors. I hope I don't
have to split all those records into Firstname Lastname parts. I'm open to
suggestions on how to handle this, including (i hope not) splitting things up.
Here's the code I'm using:
Private Sub cboSearch_BeforeUpdate(Cancel As Integer)
Dim rst As DAO.Recordset
Dim myStr As String
myStr = Me.cboSearch.Column(1)
myStr = Left$([myStr], InStr(1, [myStr], ",") - 1)
Set rst = Me.RecordsetClone
rst.FindFirst myStr
If rst.NoMatch Then
MsgBox "No entry found.", vbInformation
Else
Me.Bookmark = rst.Bookmark
End If
End Sub