View Full Version : Graph based on query


Sniper-BoOyA-
11-02-2010, 01:06 AM
Good Morning,

Ive got a (sub)form with a graph based on the following query :

SELECT IIf(IsNull([schaalnr]),[topwtrgeh],(([massaschlmonnat]-[massa3])/([massa3]-[massaschl]))*100) AS watergehproct, IIf(IsNull([schaalnr]),[topdrgdichth],((([massacillmonnat]-[massaopv])*100000)/([inhpv]*(100+[watergehproct])))) AS drgdichtheidproct, tblproctor.proctorID
FROM (tblopvklei INNER JOIN tblproctor ON tblopvklei.opvnr = tblproctor.opvnr) INNER JOIN tblproctwtrgeh ON tblproctor.proctorID = tblproctwtrgeh.proctorID
WHERE (((tblproctor.proctorID)=[Please enter the ProctorID you woud like to make the graph from]))
ORDER BY tblproctor.proctorID;


The form works great. But if i want to make a report with this graph, using the same query. I get an error saying :

"The microsoft jet database engine does not recognize [Please enter the ProctorID you woud like to make the graph from] as a valid field name or expression"

Any ideas?

TimW
12-22-2010, 03:48 AM
Hi & merry christmas
[Please enter the ProctorID you woud like to make the graph from] is a parameter that would pop up and ask you for an input. however, this does not work on your report. I am not sure where you have the Query. If I had this in VBA i would have a msgbox pop up and prompt me for the value

strProctorID = Msgbox "Please enter the ProctorID you woud like to make the graph from", vbokonly, "Enter Proctor ID"
SELECT IIf(IsNull([schaalnr]),[topwtrgeh],(([massaschlmonnat]-[massa3])/([massa3]-[massaschl]))*100) AS watergehproct, IIf(IsNull([schaalnr]),[topdrgdichth],((([massacillmonnat]-[massaopv])*100000)/([inhpv]*(100+[watergehproct])))) AS drgdichtheidproct, tblproctor.proctorID
FROM (tblopvklei INNER JOIN tblproctor ON tblopvklei.opvnr = tblproctor.opvnr) INNER JOIN tblproctwtrgeh ON tblproctor.proctorID = tblproctwtrgeh.proctorID
WHERE (((tblproctor.proctorID)=" & strProctorID & "))
ORDER BY tblproctor.proctorID;

As i said, this is how i would structure it in VBA - but not knowing any more..

tim