T
Tergiver
I have a table called Agents with these fields:
ID (autonumbered)
Name (text)
Referred By (number)
Referred By is used to point to the ID# of the agent that referred this agent.
I have a select query called QueryReferred with the following column:
Field: Referred BY
Table: Agents
Criteria: [AgentID:]
This query will find all of the agents who were referred by the supplied
agent ID.
Now I want to generate a report that lists each agent and the number of
agents they have referred.
Next to their name on the report form, I have a text box to display the
count. My really clueless attempt at expression writing led me to believe the
following would work:
=Count( Queries!QueryReferred!AgentID=[ID] )
Seems logical to me, but the following things are NOT occuring as I was
expecting:
1) The query is not getting its parameter passed to it, it's prompting for
one.
2) The query is not running once for each iteration of that line on the
report, it is only running once (or at least it is only prompting once).
3) The Count() function is returning the number of records in the report,
not the number of records returned by the query.
Can anyone help me solve this?
ID (autonumbered)
Name (text)
Referred By (number)
Referred By is used to point to the ID# of the agent that referred this agent.
I have a select query called QueryReferred with the following column:
Field: Referred BY
Table: Agents
Criteria: [AgentID:]
This query will find all of the agents who were referred by the supplied
agent ID.
Now I want to generate a report that lists each agent and the number of
agents they have referred.
Next to their name on the report form, I have a text box to display the
count. My really clueless attempt at expression writing led me to believe the
following would work:
=Count( Queries!QueryReferred!AgentID=[ID] )
Seems logical to me, but the following things are NOT occuring as I was
expecting:
1) The query is not getting its parameter passed to it, it's prompting for
one.
2) The query is not running once for each iteration of that line on the
report, it is only running once (or at least it is only prompting once).
3) The Count() function is returning the number of records in the report,
not the number of records returned by the query.
Can anyone help me solve this?