The last argument of the DCount function
v---------------v
=DCount("*","Table Name", "[ACode] = 'B'")
is how you do your filtering. It is just like writing a WHERE clause for a
query without the word WHERE. I was using your comments to build this. In
this example, it should count all records where the field Acode is equal to B.

Signature
Dave Hargis, Microsoft Access MVP
> The instructions you gave me worked fine, but I think I have asked the wrong
> question. I need to know how many people a re booked on each course eg Word
[quoted text clipped - 20 lines]
> > > > do it in a query. If you can help be please can you explain in a very basic
> > > > language for me to follow.
Chester1 - 31 Oct 2007 15:38 GMT
Klatuu
Please can you tell me how I would write a code now that will count the B's
on all the different courses scheduled so that I can then do a calculation
that will show how many places are left on the individual courses.
Regards Clair
> The last argument of the DCount function
> v---------------v
[quoted text clipped - 28 lines]
> > > > > do it in a query. If you can help be please can you explain in a very basic
> > > > > language for me to follow.
Klatuu - 31 Oct 2007 16:01 GMT
I can provide some ideas, but I don't know your data well enough to write it
for you.
First, you need to filter by course as well as by the B.
=DCount("*","Table Name", "[ACode] = 'B' AND CourseCode = '" & Me.Course &
"'")
To do the math you have to know how many total seats are available for the
course.

Signature
Dave Hargis, Microsoft Access MVP
> Klatuu
>
[quoted text clipped - 36 lines]
> > > > > > do it in a query. If you can help be please can you explain in a very basic
> > > > > > language for me to follow.
Chester1 - 31 Oct 2007 16:50 GMT
With all your help I have now managed to work out a way to get what is
required.
Many Thanks

Signature
Regards Clair
> I can provide some ideas, but I don't know your data well enough to write it
> for you.
[quoted text clipped - 47 lines]
> > > > > > > do it in a query. If you can help be please can you explain in a very basic
> > > > > > > language for me to follow.