Putting query results on report

L

Luther

Hi,

I have a query as such:

SELECT Count([PlanID]) AS HowMany
FROM HiPlanNames
WHERE (((HiPlanNames.LastUpdated)<=Date()));

I need to put the result of HowMany (this field is
calculated) with a label. Is this possible?

Thank you in advance.
 
S

Steve Schapel

Luther,

Here are a few possible ideas...
1. Add this query, not joined to the existing table(s), to the query
that your report is based on. Then the HowMany field will be available
to be included in a bound textbox on the report.
2. Put an unbound textbox on the report, and in its Control Source
property enter:
=DLookUp("[HowMany]","YourAsSuchQuery")
3. Scrap your query, and put an unbound textbox on the report, and in
its Control Source property enter:
=DCount("*","HiPlanNames","[LastUpdated]<=Date()")
 
G

Guest

Thank you; they worked!!! I like solutions 2 & 3. Very
simple.
-----Original Message-----
Luther,

Here are a few possible ideas...
1. Add this query, not joined to the existing table(s), to the query
that your report is based on. Then the HowMany field will be available
to be included in a bound textbox on the report.
2. Put an unbound textbox on the report, and in its Control Source
property enter:
=DLookUp("[HowMany]","YourAsSuchQuery")
3. Scrap your query, and put an unbound textbox on the report, and in
its Control Source property enter:
=DCount("*","HiPlanNames","[LastUpdated]<=Date()")

--
Steve Schapel, Microsoft Access MVP

Hi,

I have a query as such:

SELECT Count([PlanID]) AS HowMany
FROM HiPlanNames
WHERE (((HiPlanNames.LastUpdated)<=Date()));

I need to put the result of HowMany (this field is
calculated) with a label. Is this possible?

Thank you in advance.
.
 
Top