counting on form

  • Thread starter Thread starter _Bigred
  • Start date Start date
B

_Bigred

(Access 2000)


I have a db and want to count the occurances for the following: Table name=
Grievance Table

Individual Grievances, Group Grievances, Union Grievances


Fields are "Individual", "Group", "Union" these fields are Yes/No
(True/False) fields.

I tried =DCount("[Individual]","[Grievance Table]")

How do I get the form coding correctly inputted, so the text box will return
the count of individual grievances?

TIA,
_Bigred
 
Try

strWhere = "[Individual] = " & vbTrue

DCount("[Individual]","[Grievance Table]", sqlWhere)

That is, you use the "criteria" argument to select only the records which
meet your qualifications to be counted.

Larry Linson
Microsoft Access MVP
 
Where do I put the "below" code you provided? (Do I put in as the control
source in properties for the text box?)

TIA,
_Bigred



Larry Linson said:
Try

strWhere = "[Individual] = " & vbTrue

DCount("[Individual]","[Grievance Table]", sqlWhere)

That is, you use the "criteria" argument to select only the records which
meet your qualifications to be counted.

Larry Linson
Microsoft Access MVP
_Bigred said:
(Access 2000)


I have a db and want to count the occurances for the following: Table name=
Grievance Table

Individual Grievances, Group Grievances, Union Grievances


Fields are "Individual", "Group", "Union" these fields are Yes/No
(True/False) fields.

I tried =DCount("[Individual]","[Grievance Table]")

How do I get the form coding correctly inputted, so the text box will return
the count of individual grievances?

TIA,
_Bigred
 
for Individual Grievances:
=DCount("*","[Grievance Table]","[Individual Grievances] = -1")
for Group Grievances:
=DCount("*","[Grievance Table]","[Group Grievances] = -1")
for Union Grievances:
=DCount("*","[Grievance Table]","[Union Grievances] = -1")
 
Thanks Fred.

Appreciate your help,
_Bigred



Fredg said:
for Individual Grievances:
=DCount("*","[Grievance Table]","[Individual Grievances] = -1")
for Group Grievances:
=DCount("*","[Grievance Table]","[Group Grievances] = -1")
for Union Grievances:
=DCount("*","[Grievance Table]","[Union Grievances] = -1")

--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.


_Bigred said:
(Access 2000)


I have a db and want to count the occurances for the following: Table name=
Grievance Table

Individual Grievances, Group Grievances, Union Grievances


Fields are "Individual", "Group", "Union" these fields are Yes/No
(True/False) fields.

I tried =DCount("[Individual]","[Grievance Table]")

How do I get the form coding correctly inputted, so the text box will return
the count of individual grievances?

TIA,
_Bigred
 
Back
Top