N
Nika
I have created a last anme combo box in Access Form 2003, using the wizard.
For some reasons I couldn't search last names with apostrope. Well, I have
received a tip on the forum and I have entered the code (please see below).
However, I have recently converted Access 2003 to 2007 and my search box
doesn't work at all.
Does any one know why?
I will greatly appreciate your answers.
Thank you.
Private Sub Combo384_AfterUpdate()
Dim rs As DAO.Recordset
Dim strWhere As String
If Me.Dirty Then Me.Dirty = False
Set rs = Me.RecordsetClone
strWhere = "[LAST NAME] = """ & Me![Combo384] & """"
rs.FindFirst strWhere
If rs.NoMatch Then
MsgBox "Not found"
Else
Me.Bookmark = rs.Bookmark
End If
Set rs = Nothing
End Sub
For some reasons I couldn't search last names with apostrope. Well, I have
received a tip on the forum and I have entered the code (please see below).
However, I have recently converted Access 2003 to 2007 and my search box
doesn't work at all.
Does any one know why?
I will greatly appreciate your answers.
Thank you.
Private Sub Combo384_AfterUpdate()
Dim rs As DAO.Recordset
Dim strWhere As String
If Me.Dirty Then Me.Dirty = False
Set rs = Me.RecordsetClone
strWhere = "[LAST NAME] = """ & Me![Combo384] & """"
rs.FindFirst strWhere
If rs.NoMatch Then
MsgBox "Not found"
Else
Me.Bookmark = rs.Bookmark
End If
Set rs = Nothing
End Sub