View Full Version : Counting items in query


Graham Bucknall
06-27-2003, 08:19 AM
I have a query listing those people who attended a training session. The query contains sessionid, attendeeid, surname.

I want to be able to add up all of those present. I have tried putting "count" in and just end up with a series of "1".

How can I get it to add up all of those who were present?

jeremie_ingram
06-27-2003, 08:46 AM
One question, what are you doing with the returned query data? If you are putting it into a report only, then you could use the features in the report itself to count these individuals.

Graham Bucknall
06-27-2003, 09:09 AM
What I want to do is to produce some totals on a subform. I have set up a form with a subform. The main form allows an event to be chosen and shows details of that event - date, title etc.
In the subform below there is a list of those who are goint to attend the event. I want to see a running total somewhere (ideally on the main form) so that I know when to stop. If there is a better way of doing it that using a query then I would love to know.

Fizzio
06-27-2003, 09:24 AM
You don't need a query to do this, set up an unbound field in the footer or header of the subform and set the controlsource to
=Count([AnyField]) where AnyField is any field in the dataset.

You can put a reference to this on the main form by creating an unbound control and setting the controlsource to
=Forms!MainformName!SubformName.Form!NameOfTotalCo ntrol

you can count this remotely from the main from but I find this method easy enough

Graham Bucknall
06-30-2003, 01:30 AM
That worked fine - many thanks.

JonatABS
07-14-2003, 12:33 PM
Ok Im completely lost on this one. How do you ppl explain and understand this crap.

I have the same situation.

However its LITTLE different.

I have a list that has a query that shows year and totals for those years for each employee. This is on a subform within a tab form.

I first DONT want duplicate years to show up. (these are chosen witha drop down on the subform)
I then want to keep a running total of the years.

Thanks