help on Record Counting

  • Thread starter Thread starter Anthony
  • Start date Start date
A

Anthony

I have a form with a subform called [MPPTbl subform], the
subform shows patient information, I want to cound
certain records that show certain numbers in the form.
for example I want to cound records that have a number
between 14 and 7, and I want to be able to count records
that are lessthan 7 or any number that I choose. The
textbox that holds the data is called [DT]. I can count
the total recrods in the subform, but do not know how to
count certain records. I need to be able to show the
status of the how many records that fall between two
numbers or that is less than a number so that the medical
staff can now the status of the patients.

can any body help, Thanks, Anthony
 
I cant find anything about the DCount() that you are
talking about. can you spesify more about it?

-----Original Message-----
Have you looked at the DCount() function?

- Turtle

I have a form with a subform called [MPPTbl subform], the
subform shows patient information, I want to cound
certain records that show certain numbers in the form.
for example I want to cound records that have a number
between 14 and 7, and I want to be able to count records
that are lessthan 7 or any number that I choose. The
textbox that holds the data is called [DT]. I can count
the total recrods in the subform, but do not know how to
count certain records. I need to be able to show the
status of the how many records that fall between two
numbers or that is less than a number so that the medical
staff can now the status of the patients.

can any body help, Thanks, Anthony


.
 
Anthony said:
I have a form with a subform called [MPPTbl subform], the
subform shows patient information, I want to cound
certain records that show certain numbers in the form.
for example I want to cound records that have a number
between 14 and 7, and I want to be able to count records
that are lessthan 7 or any number that I choose. The
textbox that holds the data is called [DT]. I can count
the total recrods in the subform, but do not know how to
count certain records. I need to be able to show the
status of the how many records that fall between two
numbers or that is less than a number so that the medical
staff can now the status of the patients.


Where do the two numbers come from?

If you just want to code the numbers into the program, you
could use a text box in the subform's footer section. Its
expression could be:
=Count(IIf(DT Between 7 And 14, 1, Null))
or =Sum(IIf(DT Between 7 And 14, 1, 0))
or =Abs(Sum(DT Between 7 And 14))

To count the ones less than 7, use the same kind of
expression except using the condition DT < 7.
 
Where are you looking that you can't find it?
I found a good description (better than I could do myself) by searching on
DCount in the Access Help file.

HTH
- Turtle

Antthony said:
I cant find anything about the DCount() that you are
talking about. can you spesify more about it?

-----Original Message-----
Have you looked at the DCount() function?

- Turtle

I have a form with a subform called [MPPTbl subform], the
subform shows patient information, I want to cound
certain records that show certain numbers in the form.
for example I want to cound records that have a number
between 14 and 7, and I want to be able to count records
that are lessthan 7 or any number that I choose. The
textbox that holds the data is called [DT]. I can count
the total recrods in the subform, but do not know how to
count certain records. I need to be able to show the
status of the how many records that fall between two
numbers or that is less than a number so that the medical
staff can now the status of the patients.

can any body help, Thanks, Anthony


.
 
The Two numbers are going to be coded in, but when I try
to use the expressions that you gave me, I get an error.
and I have tried to playwith them and still get an error.
Could there be something that I am missing..?

Thanks Anthony

-----Original Message-----
Anthony said:
I have a form with a subform called [MPPTbl subform], the
subform shows patient information, I want to cound
certain records that show certain numbers in the form.
for example I want to cound records that have a number
between 14 and 7, and I want to be able to count records
that are lessthan 7 or any number that I choose. The
textbox that holds the data is called [DT]. I can count
the total recrods in the subform, but do not know how to
count certain records. I need to be able to show the
status of the how many records that fall between two
numbers or that is less than a number so that the medical
staff can now the status of the patients.


Where do the two numbers come from?

If you just want to code the numbers into the program, you
could use a text box in the subform's footer section. Its
expression could be:
=Count(IIf(DT Between 7 And 14, 1, Null))
or =Sum(IIf(DT Between 7 And 14, 1, 0))
or =Abs(Sum(DT Between 7 And 14))

To count the ones less than 7, use the same kind of
expression except using the condition DT < 7.
 
How would I use the DCount() as an IIf Statment or just
count records between two numbers only on the subform,
not the table it self?
-----Original Message-----
Where are you looking that you can't find it?
I found a good description (better than I could do myself) by searching on
DCount in the Access Help file.

HTH
- Turtle

I cant find anything about the DCount() that you are
talking about. can you spesify more about it?

-----Original Message-----
Have you looked at the DCount() function?

- Turtle

"Anthony" <[email protected]> wrote
in
message
I have a form with a subform called [MPPTbl
subform],
the
subform shows patient information, I want to cound
certain records that show certain numbers in the form.
for example I want to cound records that have a number
between 14 and 7, and I want to be able to count records
that are lessthan 7 or any number that I choose. The
textbox that holds the data is called [DT]. I can count
the total recrods in the subform, but do not know
how
to
count certain records. I need to be able to show the
status of the how many records that fall between two
numbers or that is less than a number so that the medical
staff can now the status of the patients.

can any body help, Thanks, Anthony


.


.
 
Construct the third argument of DCount to include only the items you want.
You can use AND to implement more than one condition.
"[Field1]>20 AND [Field1]<25" for example.
You can add conditions which will return the same records as your subform,
too.

HTH
- Turtle

Anthony said:
How would I use the DCount() as an IIf Statment or just
count records between two numbers only on the subform,
not the table it self?
-----Original Message-----
Where are you looking that you can't find it?
I found a good description (better than I could do myself) by searching on
DCount in the Access Help file.

HTH
- Turtle

I cant find anything about the DCount() that you are
talking about. can you spesify more about it?


-----Original Message-----
Have you looked at the DCount() function?

- Turtle

message
I have a form with a subform called [MPPTbl subform],
the
subform shows patient information, I want to cound
certain records that show certain numbers in the form.
for example I want to cound records that have a number
between 14 and 7, and I want to be able to count
records
that are lessthan 7 or any number that I choose. The
textbox that holds the data is called [DT]. I can count
the total recrods in the subform, but do not know how
to
count certain records. I need to be able to show the
status of the how many records that fall between two
numbers or that is less than a number so that the
medical
staff can now the status of the patients.

can any body help, Thanks, Anthony


.


.
 
Anthony said:
The Two numbers are going to be coded in, but when I try
to use the expressions that you gave me, I get an error.
and I have tried to playwith them and still get an error.
Could there be something that I am missing..?


What error do you get?

A couple of things to remember. Those expressions must be
used in a text box in the subform's footer section, not in
VBA code. Also, DT must be the name of a field in the
subform's RecordSource table/query, not the name of a
control on the subform.
--
Marsh
MVP [MS Access]


-----Original Message-----
Anthony said:
I have a form with a subform called [MPPTbl subform], the
subform shows patient information, I want to cound
certain records that show certain numbers in the form.
for example I want to cound records that have a number
between 14 and 7, and I want to be able to count records
that are lessthan 7 or any number that I choose. The
textbox that holds the data is called [DT]. I can count
the total recrods in the subform, but do not know how to
count certain records. I need to be able to show the
status of the how many records that fall between two
numbers or that is less than a number so that the medical
staff can now the status of the patients.


Where do the two numbers come from?

If you just want to code the numbers into the program, you
could use a text box in the subform's footer section. Its
expression could be:
=Count(IIf(DT Between 7 And 14, 1, Null))
or =Sum(IIf(DT Between 7 And 14, 1, 0))
or =Abs(Sum(DT Between 7 And 14))

To count the ones less than 7, use the same kind of
expression except using the condition DT < 7.
 
Back
Top