Counting filtered records...

G

george 16-17

Greetings all,

I have a search form with a text box in the footer that count records with
=Count(*) and have another text box with DCount function with the expression
="Number reviewed: " & DCount("Review","qryMainInjuryTable","Review=-1").
Both work fine, but the dcount text box is not affected after the form filter
is applied like the count expression.

Is there a method to to count records with a "where" statement after the
filter is applied? I have searched this newsgroup, but can't seem to find an
answer.

Thanks in advance,
george
 
F

fredg

Greetings all,

I have a search form with a text box in the footer that count records with
=Count(*) and have another text box with DCount function with the expression
="Number reviewed: " & DCount("Review","qryMainInjuryTable","Review=-1").
Both work fine, but the dcount text box is not affected after the form filter
is applied like the count expression.

Is there a method to to count records with a "where" statement after the
filter is applied? I have searched this newsgroup, but can't seem to find an
answer.

Thanks in advance,
george

On a form?
Use an unbound text control:
=[RecordsetClone].[RecordCount]
 
G

george 16-17

Hi Fred,

Thanks for taking a look. Unfortunately, that did not work and yes this is
on a form. I probably did not explain it well in my original post. What I
want to do is count the number of records there are investigated (WHERE
[Investigated] = -1) after the form filter is applied. The field
"Investigated" is a true/false field. Let me know if more info is
needed...I'm still learning.

Thanks again,
george

fredg said:
Greetings all,

I have a search form with a text box in the footer that count records with
=Count(*) and have another text box with DCount function with the expression
="Number reviewed: " & DCount("Review","qryMainInjuryTable","Review=-1").
Both work fine, but the dcount text box is not affected after the form filter
is applied like the count expression.

Is there a method to to count records with a "where" statement after the
filter is applied? I have searched this newsgroup, but can't seem to find an
answer.

Thanks in advance,
george

On a form?
Use an unbound text control:
=[RecordsetClone].[RecordCount]
 
F

fredg

Hi Fred,

Thanks for taking a look. Unfortunately, that did not work and yes this is
on a form. I probably did not explain it well in my original post. What I
want to do is count the number of records there are investigated (WHERE
[Investigated] = -1) after the form filter is applied. The field
"Investigated" is a true/false field. Let me know if more info is
needed...I'm still learning.

Thanks again,
george

fredg said:
Greetings all,

I have a search form with a text box in the footer that count records with
=Count(*) and have another text box with DCount function with the expression
="Number reviewed: " & DCount("Review","qryMainInjuryTable","Review=-1").
Both work fine, but the dcount text box is not affected after the form filter
is applied like the count expression.

Is there a method to to count records with a "where" statement after the
filter is applied? I have searched this newsgroup, but can't seem to find an
answer.

Thanks in advance,
george

On a form?
Use an unbound text control:
=[RecordsetClone].[RecordCount]

You have to help us help you.
What does "did not work" mean?
The computer crashed?
The control displayed #Error?
It displayed #Name?
It gave an incorrect value? Are you absolutely sure?
If so, what value did it display and what should it have displayed?

The expression I gave you will return the actual number of records in
the form recordsource, both if there is NO filter and, if a filter is
applied, AFTER filtering.
 
G

george 16-17

Hi Fred,

Sorry...the unbound text box displayed "#Name?".

george

fredg said:
Hi Fred,

Thanks for taking a look. Unfortunately, that did not work and yes this is
on a form. I probably did not explain it well in my original post. What I
want to do is count the number of records there are investigated (WHERE
[Investigated] = -1) after the form filter is applied. The field
"Investigated" is a true/false field. Let me know if more info is
needed...I'm still learning.

Thanks again,
george

fredg said:
On Mon, 8 Jun 2009 07:30:01 -0700, george 16-17 wrote:

Greetings all,

I have a search form with a text box in the footer that count records with
=Count(*) and have another text box with DCount function with the expression
="Number reviewed: " & DCount("Review","qryMainInjuryTable","Review=-1").
Both work fine, but the dcount text box is not affected after the form filter
is applied like the count expression.

Is there a method to to count records with a "where" statement after the
filter is applied? I have searched this newsgroup, but can't seem to find an
answer.

Thanks in advance,
george

On a form?
Use an unbound text control:
=[RecordsetClone].[RecordCount]

You have to help us help you.
What does "did not work" mean?
The computer crashed?
The control displayed #Error?
It displayed #Name?
It gave an incorrect value? Are you absolutely sure?
If so, what value did it display and what should it have displayed?

The expression I gave you will return the actual number of records in
the form recordsource, both if there is NO filter and, if a filter is
applied, AFTER filtering.
 
C

Chegu Tom

Thanks fred

I needed that. I have been using too many dcounts (which are kinda slow)



fredg said:
Greetings all,

I have a search form with a text box in the footer that count records
with
=Count(*) and have another text box with DCount function with the
expression
="Number reviewed: " & DCount("Review","qryMainInjuryTable","Review=-1").
Both work fine, but the dcount text box is not affected after the form
filter
is applied like the count expression.

Is there a method to to count records with a "where" statement after the
filter is applied? I have searched this newsgroup, but can't seem to find
an
answer.

Thanks in advance,
george

On a form?
Use an unbound text control:
=[RecordsetClone].[RecordCount]
 
F

fredg

Hi Fred,

Sorry...the unbound text box displayed "#Name?".

george

fredg said:
Hi Fred,

Thanks for taking a look. Unfortunately, that did not work and yes this is
on a form. I probably did not explain it well in my original post. What I
want to do is count the number of records there are investigated (WHERE
[Investigated] = -1) after the form filter is applied. The field
"Investigated" is a true/false field. Let me know if more info is
needed...I'm still learning.

Thanks again,
george

:

On Mon, 8 Jun 2009 07:30:01 -0700, george 16-17 wrote:

Greetings all,

I have a search form with a text box in the footer that count records with
=Count(*) and have another text box with DCount function with the expression
="Number reviewed: " & DCount("Review","qryMainInjuryTable","Review=-1").
Both work fine, but the dcount text box is not affected after the form filter
is applied like the count expression.

Is there a method to to count records with a "where" statement after the
filter is applied? I have searched this newsgroup, but can't seem to find an
answer.

Thanks in advance,
george

On a form?
Use an unbound text control:
=[RecordsetClone].[RecordCount]

You have to help us help you.
What does "did not work" mean?
The computer crashed?
The control displayed #Error?
It displayed #Name?
It gave an incorrect value? Are you absolutely sure?
If so, what value did it display and what should it have displayed?

The expression I gave you will return the actual number of records in
the form recordsource, both if there is NO filter and, if a filter is
applied, AFTER filtering.

If a control displays #Name that means it cannot identify a part of an
expression as a field name, i.e. you've miss-spelled the field named
[Apples] as [Appels].

Here is the expression again. Copy it to the clipboard and then paste
it into the control source of that unbound control.

=[RecordsetClone].[RecordCount]
 
G

george 16-17

Hi Fred,

Thanks for trying to help. I still cannot get it to work - #Name? keeps
displaying. I am not sure what I am doing wrong. However, I was able to get
the desired result with the following:

="Investigated: " & Abs(Sum([Investigated]=-1))

This equation allows me to find the total number where "Investigated = True"
with and without the filter.

I appreciate your efforts,
george

fredg said:
Hi Fred,

Sorry...the unbound text box displayed "#Name?".

george

fredg said:
On Mon, 8 Jun 2009 09:26:01 -0700, george 16-17 wrote:

Hi Fred,

Thanks for taking a look. Unfortunately, that did not work and yes this is
on a form. I probably did not explain it well in my original post. What I
want to do is count the number of records there are investigated (WHERE
[Investigated] = -1) after the form filter is applied. The field
"Investigated" is a true/false field. Let me know if more info is
needed...I'm still learning.

Thanks again,
george

:

On Mon, 8 Jun 2009 07:30:01 -0700, george 16-17 wrote:

Greetings all,

I have a search form with a text box in the footer that count records with
=Count(*) and have another text box with DCount function with the expression
="Number reviewed: " & DCount("Review","qryMainInjuryTable","Review=-1").
Both work fine, but the dcount text box is not affected after the form filter
is applied like the count expression.

Is there a method to to count records with a "where" statement after the
filter is applied? I have searched this newsgroup, but can't seem to find an
answer.

Thanks in advance,
george

On a form?
Use an unbound text control:
=[RecordsetClone].[RecordCount]
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail


You have to help us help you.
What does "did not work" mean?
The computer crashed?
The control displayed #Error?
It displayed #Name?
It gave an incorrect value? Are you absolutely sure?
If so, what value did it display and what should it have displayed?

The expression I gave you will return the actual number of records in
the form recordsource, both if there is NO filter and, if a filter is
applied, AFTER filtering.

If a control displays #Name that means it cannot identify a part of an
expression as a field name, i.e. you've miss-spelled the field named
[Apples] as [Appels].

Here is the expression again. Copy it to the clipboard and then paste
it into the control source of that unbound control.

=[RecordsetClone].[RecordCount]
 

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

Similar Threads

Access Dcount (multiple criteria) 3
dcount 1
Access MS Access DCount function problem 0
DCount problem redux 4
Display Count of records from subform on Main form 7
Counting records on a form after filter 1
Coutif ? 4
DCount & record selector 3

Top