Graph of Group data in Group Footer

G

GT

I have a table called "data" with fields TIME and LEVEL.
I generate a report "levels" of LEVEL against TIME grouped by day and week.
The query I use is like this...

SELECT data.TIME, data.LEVEL
FROM data
WHERE (((DateValue([data]![TIME]))>=DateValue([From_Date]) And
(DateValue([data]![TIME]))<=DateValue([To_Date])))
ORDER BY data.TIME;

You can see that it will ask for the "From_Time" and "To_Time" and the data
is generated.
On the report, I group the data so that only the data from one week occupy
the page.

Now I also have a graph in the TIME footer that is supposed to show the data
listed in the report for the week.
If I choose the row source for the graph to be the query shown above, the
graph shows the correct data, however it asks for the "From_Time" and
"To_Time" whenever the graph pops up on the screen or is printed.

I need toask for"From_Time" and "To_Time" for the report as a whole, but the
graph needs to get its row source without having to ask. How do I make the
graph select its data from what is shown on the report?
 
J

John Spencer

Instead of using a parameter prompt, use a form and reference the
controls on the form

Parameters Forms!MyCriteriaForm![From_Date] DateTime,
Forms!MyCriteriaForm![To_Date] DateTime;
SELECT data.TIME, data.LEVEL
FROM data
WHERE DateValue([data]![TIME])>=Forms!MyCriteriaForm![From_Date] And
DateValue([data]![TIME])<=Forms!MyCriteriaForm![To_Date]
ORDER BY data.TIME;

Also, I would recommend that you change the data type of Time to a
datetime field if at all possible. It will make life much easier.

Check out this article for a detailed discussion.
http://www.fontstuff.com/access/acctut08.htm

Or check out this from MS
http://office.microsoft.com/en-us/access/HA011730581033.aspx

Or for another example
http://allenbrowne.com/ser-62.html


A brief quote from a John Vinson (Access MVP) posting.

You'll need to create a small unbound Form (let's call it frmCriteria)
with a Combo Box control (cboCrit) on it. Use the combo box wizard to
select the table for the selections, and be
sure that the bound field of the combo is the value you want to use as a
criterion. Save this form.

Now use

=[Forms]![frmCriteria]![cboCrit]

as the criterion in your Query.

It's convenient to base a second Form or Report on the resulting query
to display the results; if you put a button on frmCriteria to launch
that form or report, the user can enter the criterion and view the
results in one simple operation!

Quoting John Vinson

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================

I have a table called "data" with fields TIME and LEVEL.
I generate a report "levels" of LEVEL against TIME grouped by day and week.
The query I use is like this...

SELECT data.TIME, data.LEVEL
FROM data
WHERE (((DateValue([data]![TIME]))>=DateValue([From_Date]) And
(DateValue([data]![TIME]))<=DateValue([To_Date])))
ORDER BY data.TIME;

You can see that it will ask for the "From_Time" and "To_Time" and the
data is generated.
On the report, I group the data so that only the data from one week
occupy the page.

Now I also have a graph in the TIME footer that is supposed to show the
data listed in the report for the week.
If I choose the row source for the graph to be the query shown above,
the graph shows the correct data, however it asks for the "From_Time"
and "To_Time" whenever the graph pops up on the screen or is printed.

I need toask for"From_Time" and "To_Time" for the report as a whole, but
the graph needs to get its row source without having to ask. How do I
make the graph select its data from what is shown on the report?
 

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