If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
counting the number of records in a list box
What expression can I use as the Control Source of a text box in the detail
section of a form to count the number of records in a list box? I have a form named frm_list_project with a list box named List2. I'd like to have a text box in the detail section at the top of the form that displays the number of records in the list box. I've looked in Help and tried various things like Me!List2.RecordCount but get messages like "Object doesn't support that property." What expression can I use to display the number of records? Thanks in advance, Paul |
#2
|
|||
|
|||
counting the number of records in a list box
Just
=[lstBoxName].[listcount] Damon "Paul" wrote in message ... What expression can I use as the Control Source of a text box in the detail section of a form to count the number of records in a list box? I have a form named frm_list_project with a list box named List2. I'd like to have a text box in the detail section at the top of the form that displays the number of records in the list box. I've looked in Help and tried various things like Me!List2.RecordCount but get messages like "Object doesn't support that property." What expression can I use to display the number of records? Thanks in advance, Paul |
#3
|
|||
|
|||
counting the number of records in a list box
If your list box uses a select statement why not copy, edit to a totals query
and use that. -- KARL DEWEY Build a little - Test a little "Paul" wrote: What expression can I use as the Control Source of a text box in the detail section of a form to count the number of records in a list box? I have a form named frm_list_project with a list box named List2. I'd like to have a text box in the detail section at the top of the form that displays the number of records in the list box. I've looked in Help and tried various things like Me!List2.RecordCount but get messages like "Object doesn't support that property." What expression can I use to display the number of records? Thanks in advance, Paul |
#4
|
|||
|
|||
counting the number of records in a list box
Works great. Thanks, Damon.
|
#5
|
|||
|
|||
counting the number of records in a list box
Interesting suggestion, Karl, but then Access has to run the query twice, so
I would guess it might be easier for it to evaluate the ListCount property. However, I might be able to use your idea in a different form, so I tried it out, but I got a displayed value of "#Name?" if I simply put the SELECT statement into the Control Source property of a Text Box. I then tried preceding the SELECT statement with an equal sign, but it wouldn't take that. Can you tell me what syntax to use to get the text box to display the result of that total query? Thanks |
#6
|
|||
|
|||
listbox count
MyObject.ListCount - Abs(MyObject.ColumnHeads)
this code takes into account if you have headers in your listbox and if so, subtracts 1 so as to NOT count the header row. |
#7
|
|||
|
|||
listbox count
Thanks for the suggestion, crazyaccessprogrammer.
In this case, I'm not using column headers, but this will be helpful for a situation where I do use them. |
Thread Tools | |
Display Modes | |
|
|