I have a Q about Access reports:
I have a report with list box fields with 4 values each (1 to 4) and I want to count a value only if its 1?
I wonder if it's possible?
Create a query using the table input to your Report. Include all of the fields from the table and a new calculated field. Copy and Paste this code into a new column in your query. Now Save and Name the query. Use this query as the RecordSource for your report instead of the table.
Code:
LB_Value_1: IIF([ListBoxValue]=1,1,0)
Create a text control in your detail section of the report using the field LB_Value_1 as the Control source. This control's visible property should be set to NO. Just make it small and tuck it off in the corner of the Detail Section.
Now in a Group Footer, Page Footer, or Report Footer create a calculated control with the following code in the Control Source:
Code:
=Sum([LB_Value_1])
Because only List Box values of 1 will have a 1 in this control and all others will be zero(0) then summing this control will give you a count of the records with a 1 in the list.
Post back if you have any questions.
Bob Scriver
[blue]Want the best answers? See FAQ181-2886[/blue]
Thank U for the reply.
I have another Q:
I'm trying to creat a Questionaire DB and report the results.
I have a table with different fields(questions) and the data(results) is between 1 to 4.
Is it posibble to creat a report that will show my results and count each #1 and each #2 and each #3 and each #4 and will give me the evarage of each group of #'s?
Ok now I have my Survey data base however, I would like to sum and everage a specific question for a number of surveys(I.e I have 4 surveys, and in each survey for Q #1 I have different answers: 1, 2, 2, 4).
How do I sum and average a # of surveys???
You might need to create your own query that selects the responses where the questionID is in a list of questionids:
The criteria under QuestionID might be something like:
In (234,195,228,321)
Duane
MS Access MVP
Find out how to get great answers faq219-2884.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.