counting the number of records in a list box

P

Paul

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
 
K

KARL DEWEY

If your list box uses a select statement why not copy, edit to a totals query
and use that.
 
P

Paul

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
 

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

Top