Calculate total number of records

  • Thread starter Thread starter Vince
  • Start date Start date
V

Vince

How can I calculate the total number of records generated
in a listbox, lstResult? I have provided a text box below
lstResult for the user to view the total number of records.

Thanks.
 
Vince,

First of all, you need to identify the appropriate event to fire the code to
do this for you... It might be Form Load, or a piece of code that changes
the items in the list or... it depends on what you're doing. The rest is
very very sipmle, all it takes is the following line of code:

Forms("FormName").Controls("TextBoxName") =
Froms("FormName").Controls("ListBoxName").ListCount

If the code is run from within the form's module, you coiuld simplify the
syntax to:

Me.TextBoxName = Me.ListBoxName.ListCount

Just make sure to substitute the form and controls names with the actual
ones.

HTH,
Nikos
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Count number of uniqe cases 2
Listbox SEARCH Dev Ashish 4
Dev Ashish Search record count 2
ListBox Problem 1
Listbox 2
PLEASE HELP.....List Box Search Form 1
Access Updating inventory levels 0
Selecting Double Click on Value 5

Back
Top