count listbox

kingsgambit

Registered User.
Local time
Today, 22:24
Joined
May 27, 2001
Messages
134
I have a search form, there are several text boxes and a listbox, the user enters in a title of a book and clicks search, the code behind the search is a sql query, it populates the listbox with the query result.
How can I put a text box on the form that will show how many results where found
 
Use this code in the same event where you populate the listbox:
Me.txtResult=Me.lstBox.ListCount

You might want to make the text box read-only, as in not enabled and locked, so that users won't think they can change it.
 
It gave me an error this property is read-only and can not be set
 
In that code example, did you substitute the names of your own controls for txtResult and lstBox?
 
Yes, I found that if I put
Control Source=[searchresult].[ListCount]-1 & " Records Found."
it works
 

Users who are viewing this thread

Back
Top Bottom