Graph based on query

Sniper-BoOyA-

Registered User.
Local time
Today, 08:44
Joined
Jun 15, 2010
Messages
204
Good Morning,

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

Code:
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?
 
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
 

Users who are viewing this thread

Back
Top Bottom