Where do I put these formulas?

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!
 
F

fredg

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.
 

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