I looked throughout the properties of the listbox, but i didn't see anything that would affect which record to display. I'm pretty sure there's some code I have to change.
Here's what I have for when you type in the Seach Box. The search box is named "SearchName" and the list box is called "SearchNameList":
Code:
Private Sub SearchName_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Last] = '" & Me![SearchNameList] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
Code:
Private Sub SearchName_Change()
SearchRecordset Me.SearchName, _
Me.SearchNameList, "Last"
End Sub
Code:
Private Sub SearchName_Exit(Cancel As Integer)
UpdateSearch Me.SearchName, Me.SearchNameList
End Sub
Code:
Private Sub SearchNameList_AfterUpdate()
UpdateSearch Me.SearchName, Me.SearchNameList
End Sub
Code:
Private Sub SearchNameList_Click()
DoCmd.ShowAllRecords
DoCmd.GoToControl ("Last")
DoCmd.FindRecord Me!SearchNameList
End Sub
"Last" is the Last Name column I have. I have a column for SSN#'s called "SSAN". I would like it so that when you click on a record in the listbox, it displays the record based on SSN#, not Last Name. I attached my sample database so you can see what I'm talking about.