Where do I put these formulas?

  • Thread starter Thread starter Dave R.
  • Start date Start date
D

Dave R.

I have some formulas to count the # of checked checkboxes for columns
"question1" "question2", etc.

For a report:

=DCount("[Question1]","[table name]","[Question1]=Yes")
=DCount("[Question2]","[table name]","[Question2]=Yes")
=DCount("[Question3]","[table name]","[Question3]=Yes")

Not sure if these are for report or query:

Question1Checked:ABS(Sum([Question1]))
Question2Checked:ABS(Sum([Question2]))



Can someone tell me how I go about using these formulas? I don't know where
to put them!
 
I have some formulas to count the # of checked checkboxes for columns
"question1" "question2", etc.

For a report:

=DCount("[Question1]","[table name]","[Question1]=Yes")
=DCount("[Question2]","[table name]","[Question2]=Yes")
=DCount("[Question3]","[table name]","[Question3]=Yes")

Not sure if these are for report or query:

Question1Checked:ABS(Sum([Question1]))
Question2Checked:ABS(Sum([Question2]))



Can someone tell me how I go about using these formulas? I don't know where
to put them!

If you wish to do this in a report, then, as the control source of an
UNBOUND control:

=DCount("[Question1]","[table name]","[Question1]=Yes")
or..
=ABS(Sum([Question1]))

etc. for each additional Question.

If you do this in a query, then add a new column for each expression:

Question1Checked:DCount("[Question1]","[tablename]","[Question1]=Yes")

or...

Question1Checked:ABS(Sum([Question1]))

The DCount() will count all in the Table, whether or not they are
included in the query.
The ABS(SUM()) will only count those in the query.
In the query, the text before the : becomes the name of the column and
can be used in a report just as a field name would be used.
So, if you based a report upon the query, you would use
[Question1Checked] as a field name.
 
Back
Top