I am pretty much a beginner with VB but have a access form with a table and a filtered List Box to show only some of the records in the table. How do I add a counter to show the number of records pulled up by the filtered list box. I’ve looked at “count” and “dcount” but can’t figure how to put code into the form to use these. This is the code that I use in a command button to filter the result in the list box named "ListBoxClientName".
Dim strSearch As String
strSearch = InputBox("Enter Client Name")
strSearch = "*" & strSearch & "*"
If Not IsNull(strSearch) Then
strSQL = "SELECT ID, ClientID, ClientName,ZipCode FROM tblClients " & _
"WHERE ClientName LIKE '" & strSearch & "*'" & _
" ORDER BY ClientName "
Me.ListBoxClientName.RowSource = strSQL
End If
I could either display the result in a column in the list box or a text box adjacent to it. (Unless there is a better way). But I’m not sure how to build in the code. Thanks Russ
Dim strSearch As String
strSearch = InputBox("Enter Client Name")
strSearch = "*" & strSearch & "*"
If Not IsNull(strSearch) Then
strSQL = "SELECT ID, ClientID, ClientName,ZipCode FROM tblClients " & _
"WHERE ClientName LIKE '" & strSearch & "*'" & _
" ORDER BY ClientName "
Me.ListBoxClientName.RowSource = strSQL
End If
I could either display the result in a column in the list box or a text box adjacent to it. (Unless there is a better way). But I’m not sure how to build in the code. Thanks Russ