macraniano
Technical User
I have a text box and a list box.
List box is showing all my clients from a query that contains Lname, Fname & SSN.
I have a text box that will allow me to type the last name, or partial last name, filtering the list from the listbox (working somehow like the combobox, where you start typing and it jumps right to the letter or word you typed).
So far, on the query [qryListBox], for the Lname criteria I wrote:
Like [forms]![frmSearchTable]![txtLname].[text] & "*"
For the text box, under "On Change" Event:
Private Sub txtLname_Change()
Me!lstSearch.Requery
End Sub
and for the listbox, under "After Update"
Private Sub lstSearch_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
On Error Resume Next
rs.FindFirst "[Lname] = '" & Me![lstSearch] & "'"
If Not rs.EOF Then
Me.Bookmark = rs.Bookmark
End If
End Sub
It does work, but Every time I click on any of the people in the list, I keep getting Error 91, "Object variable, or with block variable not set" Unable to figure this out.
I would like to click on one of the options from the list, so it opens another form showing the selected person's information.
HELP!!!!
What am I missing?
Thanks!!!!
List box is showing all my clients from a query that contains Lname, Fname & SSN.
I have a text box that will allow me to type the last name, or partial last name, filtering the list from the listbox (working somehow like the combobox, where you start typing and it jumps right to the letter or word you typed).
So far, on the query [qryListBox], for the Lname criteria I wrote:
Like [forms]![frmSearchTable]![txtLname].[text] & "*"
For the text box, under "On Change" Event:
Private Sub txtLname_Change()
Me!lstSearch.Requery
End Sub
and for the listbox, under "After Update"
Private Sub lstSearch_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
On Error Resume Next
rs.FindFirst "[Lname] = '" & Me![lstSearch] & "'"
If Not rs.EOF Then
Me.Bookmark = rs.Bookmark
End If
End Sub
It does work, but Every time I click on any of the people in the list, I keep getting Error 91, "Object variable, or with block variable not set" Unable to figure this out.
I would like to click on one of the options from the list, so it opens another form showing the selected person's information.
HELP!!!!
What am I missing?
Thanks!!!!