C
Cesar Zapata
Hello,
First of all thanks for taking your time reading this..
I have a form with 2 controls... 1 listbox and texbox. What i'm trying to
do is to change the rowsource of the lisbox from the textbox to show me only
the names in the textbox but when I apply the code below it does not work...
not errors the list just stays blank.
Private Sub TXTSEARCH_AfterUpdate()
Dim strSQL As String
If Not IsNull(Me![TXTSEARCH]) Then
strSQL = "SELECT TblCustomer.Last Name, TblCustomer.First
Name,TblCustomer.CustormerID FROM TblCustomer WHERE TblCustomer.Last Name
Like " & Me.TXTSEARCH.Value & """*"""
Me.ListName.RowSource = strSQL
Me.ListName.SetFocus
Else
strSQL = ""
Me.ListName.RowSource = strSQL
Me.ListName.SetFocus
End If
End Sub
Thanks,
CZ
First of all thanks for taking your time reading this..
I have a form with 2 controls... 1 listbox and texbox. What i'm trying to
do is to change the rowsource of the lisbox from the textbox to show me only
the names in the textbox but when I apply the code below it does not work...
not errors the list just stays blank.
Private Sub TXTSEARCH_AfterUpdate()
Dim strSQL As String
If Not IsNull(Me![TXTSEARCH]) Then
strSQL = "SELECT TblCustomer.Last Name, TblCustomer.First
Name,TblCustomer.CustormerID FROM TblCustomer WHERE TblCustomer.Last Name
Like " & Me.TXTSEARCH.Value & """*"""
Me.ListName.RowSource = strSQL
Me.ListName.SetFocus
Else
strSQL = ""
Me.ListName.RowSource = strSQL
Me.ListName.SetFocus
End If
End Sub
Thanks,
CZ