Private Sub ColourParetoGraph()
Dim dbs As Database
Dim qdf As QueryDef
Dim prm As Parameter
Dim rstGraphData As Recordset
' Return reference to current database.
Set dbs = CurrentDb
' Open dynaset-type Recordset object.
Set qdf = dbs.QueryDefs("qryGraphReasonsComparisons")
For Each prm In qdf.Parameters
prm.Value = Eval(prm.Name)
Next prm
Set rstGraphData = qdf.OpenRecordset()
................