i think i HATE graphs!!

capdownlondon

Registered User.
Local time
Today, 23:36
Joined
Mar 18, 2007
Messages
52
ok, basically i work in a special school for kids with behavioural difficulties.
we have a system where the kids get "red cards" if they behave badly. they get different types of red cards depending on what the behaviour is, and these are recorded dailly and repressented by codes (representing what the card was given for).

anyhow, i havea query that counts these cards, so that i can display tem on a graph.

and what i want to do, but so far cannot figure out how, is to put this graph in a form and select the child from the combo box, and it will display their graph.

the problem is i cannot do this the same way as if i was working with a subform etc, because the graph control does not seem to be able to take master/child linked fields.

this is what the graphshould look like:
to generate this i have simply gone into the query and put the criteria for name of the child as "john", so this is showing john's graph.
but what i need is to be able to hange this query the graph is based on fom a combo box.
graph.JPG


please can anyone help???

thanks

Adam
 
I'll suggest some reverse engineering here. (Don't tell Microsoft.)

Your chart is part of a form. Look at the SQL query on which the form is based. It will be some complex little statement but it will name the tables and fields.

So... once you've got the SQL, use some VBA code behind the combo box to rewrite the query dynamically with a WHERE clause to select your single student. Break the SQL into parts so that you have all of the stuff taken out of the SELECT and FROM clause. Tack on the WHERE clause. Then if there was ORDER BY or GROUP BY, tack that on to the end. THEN open the form.
 

Users who are viewing this thread

Back
Top Bottom