Hi guys,
I want my List to highlight what item I searched for. I know I need to use:
Listbox.Selected()
But I cannot figure out how to incorporate it with my Search box.
Here's my Searchbox code that's in the AfterUpdate:
Code:
Private Sub txtGoTo_AfterUpdate()
'search firstname, lastname, phone # 1, phone # 2
Dim strWhere As String
If Not IsNull(Me.txtGoTo) Then
If Me.Dirty Then 'Save before move
Me.Dirty = False
End If
strWhere = "([First Name] = """ & Me.txtGoTo & _
""" OR [Last Name] = """ & Me.txtGoTo & _
""" OR [Phone # 1] = """ & Me.txtGoTo & _
""" OR [Phone # 2] = """ & Me.txtGoTo & """)"
With Me.RecordsetClone
.FindFirst strWhere
If .NoMatch Then
MsgBox "Not found."
Else
Me.Bookmark = .Bookmark
End If
End With
End If
End Sub
Would anyone be so kind as to show me how to get my Listbox to highlight the record my Search finds?
I have:
Listbox34.Selected(#######) = true
What can I put in place of the ###### to get the record number that it found?