Access 2000 - Counting records with specific criteria

G

Guest

Please can anyone help?

I have a table that hold Course Attendees the ACode filed in the table can
be either
A - Attended
B - Booked on Course
C - Cancelled
D - Did Not Attend

I want to create something that will just count the records that are = to B
- not sure where to start as I am not sure about VBA or whether I can just
do it in a query. If you can help be please can you explain in a very basic
language for me to follow.
 
G

Guest

Sorry this may seem a bit thick but where do I type this code
--
Regards Clair


Klatuu said:
=DCount("*","Table Name", "[ACode] = 'B'")
--
Dave Hargis, Microsoft Access MVP


Chester1 said:
Please can anyone help?

I have a table that hold Course Attendees the ACode filed in the table can
be either
A - Attended
B - Booked on Course
C - Cancelled
D - Did Not Attend

I want to create something that will just count the records that are = to B
- not sure where to start as I am not sure about VBA or whether I can just
do it in a query. If you can help be please can you explain in a very basic
language for me to follow.
 
G

Guest

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
Beginners, Word Intermediate etc. The Instructions give me a total count of
the table which is very good but I now need to break the number down to give
me the count for each course. Sorry for any inconvenience. Thanks in
anticipation!
--
Regards Clair


Chester1 said:
Sorry this may seem a bit thick but where do I type this code
--
Regards Clair


Klatuu said:
=DCount("*","Table Name", "[ACode] = 'B'")
--
Dave Hargis, Microsoft Access MVP


Chester1 said:
Please can anyone help?

I have a table that hold Course Attendees the ACode filed in the table can
be either
A - Attended
B - Booked on Course
C - Cancelled
D - Did Not Attend

I want to create something that will just count the records that are = to B
- not sure where to start as I am not sure about VBA or whether I can just
do it in a query. If you can help be please can you explain in a very basic
language for me to follow.
 
G

Guest

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.
--
Dave Hargis, Microsoft Access MVP


Chester1 said:
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
Beginners, Word Intermediate etc. The Instructions give me a total count of
the table which is very good but I now need to break the number down to give
me the count for each course. Sorry for any inconvenience. Thanks in
anticipation!
--
Regards Clair


Chester1 said:
Sorry this may seem a bit thick but where do I type this code
--
Regards Clair


Klatuu said:
=DCount("*","Table Name", "[ACode] = 'B'")
--
Dave Hargis, Microsoft Access MVP


:

Please can anyone help?

I have a table that hold Course Attendees the ACode filed in the table can
be either
A - Attended
B - Booked on Course
C - Cancelled
D - Did Not Attend

I want to create something that will just count the records that are = to B
- not sure where to start as I am not sure about VBA or whether I can just
do it in a query. If you can help be please can you explain in a very basic
language for me to follow.
 
G

Guest

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


Klatuu said:
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.
--
Dave Hargis, Microsoft Access MVP


Chester1 said:
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
Beginners, Word Intermediate etc. The Instructions give me a total count of
the table which is very good but I now need to break the number down to give
me the count for each course. Sorry for any inconvenience. Thanks in
anticipation!
--
Regards Clair


Chester1 said:
Sorry this may seem a bit thick but where do I type this code
--
Regards Clair


:

=DCount("*","Table Name", "[ACode] = 'B'")
--
Dave Hargis, Microsoft Access MVP


:

Please can anyone help?

I have a table that hold Course Attendees the ACode filed in the table can
be either
A - Attended
B - Booked on Course
C - Cancelled
D - Did Not Attend

I want to create something that will just count the records that are = to B
- not sure where to start as I am not sure about VBA or whether I can just
do it in a query. If you can help be please can you explain in a very basic
language for me to follow.
 
G

Guest

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.
--
Dave Hargis, Microsoft Access MVP


Chester1 said:
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


Klatuu said:
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.
--
Dave Hargis, Microsoft Access MVP


Chester1 said:
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
Beginners, Word Intermediate etc. The Instructions give me a total count of
the table which is very good but I now need to break the number down to give
me the count for each course. Sorry for any inconvenience. Thanks in
anticipation!
--
Regards Clair


:

Sorry this may seem a bit thick but where do I type this code
--
Regards Clair


:

=DCount("*","Table Name", "[ACode] = 'B'")
--
Dave Hargis, Microsoft Access MVP


:

Please can anyone help?

I have a table that hold Course Attendees the ACode filed in the table can
be either
A - Attended
B - Booked on Course
C - Cancelled
D - Did Not Attend

I want to create something that will just count the records that are = to B
- not sure where to start as I am not sure about VBA or whether I can just
do it in a query. If you can help be please can you explain in a very basic
language for me to follow.
 
G

Guest

With all your help I have now managed to work out a way to get what is
required.

Many Thanks
--
Regards Clair


Klatuu said:
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.
--
Dave Hargis, Microsoft Access MVP


Chester1 said:
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


Klatuu said:
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.
--
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
Beginners, Word Intermediate etc. The Instructions give me a total count of
the table which is very good but I now need to break the number down to give
me the count for each course. Sorry for any inconvenience. Thanks in
anticipation!
--
Regards Clair


:

Sorry this may seem a bit thick but where do I type this code
--
Regards Clair


:

=DCount("*","Table Name", "[ACode] = 'B'")
--
Dave Hargis, Microsoft Access MVP


:

Please can anyone help?

I have a table that hold Course Attendees the ACode filed in the table can
be either
A - Attended
B - Booked on Course
C - Cancelled
D - Did Not Attend

I want to create something that will just count the records that are = to B
- not sure where to start as I am not sure about VBA or whether I can just
do it in a query. If you can help be please can you explain in a very basic
language for me to follow.
 

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