Hi Mel
You need three things to get your report:
1. a Table or Tables that holds the data you want to report on, 2. a query
that pulls the desired data from the table and 3. a report to present that
data.
Just to simplify things let me describe them in a very basic way.
Create a table that has two text fields -"Varietal" and "WineName".
Enter in three records with this data:
VARIETAL WINENAME
Cabernet Big Red
Chardonnay Big White
Cabernet Very Red
Create a query that selects the Varietal and and Winename fields for all the
records. This will pull the three records.
Create a report that has two text boxes representing the two fields (use
the Wizard for simplicity). When the Wizard asks if you want any grouping
answer Yes and specify "Varietal" as the field to group on.
When the Wizard finished switch to design view and right click on the
topmost frame of the report and select "Sorting and Grouping". Click on the
first line of the Sorting and Grouping pane (which will be Varietal). Make
sure it is sorting on Varietal) Down below select the Group footer property
and change the value to Yes. Access will add a group footer. Place a text
box control in the footer. The control will initially show the data source
as Unbound. Change that to "=Count(WineName)".
Run the report. You will see something like:
WineName Varietal
Big Red Cabernet
Very Red Cabernet
Count of this Varietal 2
Big White Chardonnay
Count of this Varietal 1
This is the simplest example but it shows you the flow you are looking for.
Your data and query will be more complex but the process will be the same.
If you understand this but are still getting "0" counts you probably need to
look at your query. If it pulls Varietals for which there is no
corresponding WineName in your data then a count of "0" would be correct.
If you don't want them in the report then screen out Null values in
WineNames.
If I've missed the point comment back.
Regards
Kevin
Mel said:
Thanks; however, that is what I have done. If the text value I was
looking
for was only 2 different values (example Yes or No), then I do get a
correct
count value.
If the text value I am looking for is more than 2 (example the 20
different
wine types), then I only receive a 0 for the count value.
I need to get a count for each of the 20 different wine types.
Is there another option?
I really appreciate your help. Thanks!
Mel
Access_Rookie said:
Hello,
Set up your report with a group header and footer. In the header, place
the
field decribing the wine and in the footer use the count function. This
with
count the number of times that wine appears in it's group. If I
understood
your question, this should work.
Hope this helps!!
Mel said:
Hello,
I am trying to count the # of each different wine shown in my report so
I
can use it in a formula to show the % of each wine in the report. I
used the
regular count funtion on one that I only had 2 values I was looking for
and
it worked great; however, it will not work of the wines for me. Below
is
what I did for the 2 values one that worked and I wished it would work
for
the wines which is about 20 different values. Can some one help me
please?
I really appreciate your help. Thanks!
=Count([VARIETAL])
=IIf([DIRECT IMPORT]="YES",Count([DIRECT IMPORT]),0)
=IIf(([COUNT DI YES]/[COUNT VARIETAL TOTAL])<>0,[COUNT DI YES]/[COUNT
VARIETAL TOTAL],0)