Report Problem - What am I doing wrong?

T

Todd D. Levy

This is a very simple report:

The query grabs an Affiliation field with 5 choices as follows:

Affiliation A
Affiliation B
Affiliation C
Affiliation D
Affiliation E

and a Date field where I ask the user to choose a Start date and an End
date with the following criteria:

Between [Please enter start date] And [Please enter end date]

The report displays only the Affiliation field, which shows up as a
Combo Box (rather than a textbox) because a lookup table is used to
populate this field.

I have 5 Unbound Textboxes with the Control Sources set as follows:

=Abs(Sum(cboAffiliation="Affiliation A"))
=Abs(Sum(cboAffiliation="Affiliation B"))
=Abs(Sum(cboAffiliation="Affiliation C"))
=Abs(Sum(cboAffiliation="Affiliation D"))
=Abs(Sum(cboAffiliation="Affiliation E"))

Because I want to get a count of the number of records returned for each
individual affiliation.

I am having 2 problems, as follows:

1) Each Unbound textbox is returning a count of Zero(0), as a numeric of
course.

2) For some reason I am being asked to enter a parameter for the
Affiliation Combo Box after I enter the date criteria.

Please, tell me what I have done wrong.

Also, I would like to have the report display (in the report) the Start
Date and End Date that the user enters when running the report; if
possible.
 
D

Duane Hookom

1) I would undo all of the lookup field stuff but that is my opinion.
2) Is the value stored in the table actually text of a number like 1-5?
3) You can't Sum controls, you can Sum fields
=Abs(Sum([Affiliation]="Affiliation A"))
or
=Abs(Sum([Affiliation]=1))
 
D

Duane Hookom

Use a text box with a control source of:
="Between " & [Please enter start date] & " And " & [Please enter end date]


--
Duane Hookom
MS Access MVP


Todd D. Levy said:
Duane,

Your explanation of the field vs. control issue solved the problem.

Thanks.

I have another question:

This report asks the user for data parameters to return all records
within the 2 dates.

I would like to capture these 2 date parameters and have them appear in
the footer of the report so that anyone who looks at it will know the
date range in question.

How can I do this?

Todd
1) I would undo all of the lookup field stuff but that is my opinion.
2) Is the value stored in the table actually text of a number like 1-5?
3) You can't Sum controls, you can Sum fields
=Abs(Sum([Affiliation]="Affiliation A"))
or
=Abs(Sum([Affiliation]=1))
 

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