D
Don
I have an unbound form with a listbox called "lstCUSTOMER", a textbox called
"txtLIKE", and a Frame with two search criteria. The problem is with my code
for search criteria 1. If I type more than just a few letters in the text
box, my ListCount recognizes the number of records, but no records are
displayed. Search criteria 2 works every time.
My code is below. Could someone give me some insight?
If Me.Frame4 = 1 Then
Me.lstCUSTOMER.RowSource = "SELECT [qryLIKE].[CUST_NO],
[qryLIKE].[CUSTOMER], [qryLIKE].[CITY], [qryLIKE].[ST], [qryLIKE].[RT] FROM
qryLIKE WHERE " & _
"[qryLIKE].[CUSTOMER] LIKE '" & Me.txtLIKE & "*'"
Else
If Me.Frame4 = 2 Then
Me.lstCUSTOMER.RowSource = "SELECT [qryLIKE].[CUST_NO],
[qryLIKE].[CUSTOMER], [qryLIKE].[CITY], [qryLIKE].[ST], [qryLIKE].[RT] FROM
qryLIKE WHERE " & _
"[qryLIKE].[CUST_NO] LIKE '" & Me.txtLIKE & "*'"
End If
End If
If Me.txtCOUNT = 0 Then
Me.Caption = "NO CUSTOMERS FOUND MATCHING THE SEARCH CRITERIA."
Else
If Me.txtCOUNT = 1 Then
Me.Caption = "1 CUSTOMER FOUND MATCHING THE SEARCH CRITERIA."
Else
If Me.txtCOUNT > 1 Then
Me.Caption = Me.txtCOUNT & " CUSTOMERS FOUND MATCHING THE
SEARCH CRITERIA."
End If
End If
End If
Me.txtLIKE.SetFocus
"txtLIKE", and a Frame with two search criteria. The problem is with my code
for search criteria 1. If I type more than just a few letters in the text
box, my ListCount recognizes the number of records, but no records are
displayed. Search criteria 2 works every time.
My code is below. Could someone give me some insight?
If Me.Frame4 = 1 Then
Me.lstCUSTOMER.RowSource = "SELECT [qryLIKE].[CUST_NO],
[qryLIKE].[CUSTOMER], [qryLIKE].[CITY], [qryLIKE].[ST], [qryLIKE].[RT] FROM
qryLIKE WHERE " & _
"[qryLIKE].[CUSTOMER] LIKE '" & Me.txtLIKE & "*'"
Else
If Me.Frame4 = 2 Then
Me.lstCUSTOMER.RowSource = "SELECT [qryLIKE].[CUST_NO],
[qryLIKE].[CUSTOMER], [qryLIKE].[CITY], [qryLIKE].[ST], [qryLIKE].[RT] FROM
qryLIKE WHERE " & _
"[qryLIKE].[CUST_NO] LIKE '" & Me.txtLIKE & "*'"
End If
End If
If Me.txtCOUNT = 0 Then
Me.Caption = "NO CUSTOMERS FOUND MATCHING THE SEARCH CRITERIA."
Else
If Me.txtCOUNT = 1 Then
Me.Caption = "1 CUSTOMER FOUND MATCHING THE SEARCH CRITERIA."
Else
If Me.txtCOUNT > 1 Then
Me.Caption = Me.txtCOUNT & " CUSTOMERS FOUND MATCHING THE
SEARCH CRITERIA."
End If
End If
End If
Me.txtLIKE.SetFocus