O
OPMCoordinator
Guest
Hello all.
im having a little trouble explaining what i nedd so please bear with me..
What I am essentially trying to do is have a record in a table that includes a query.
The thing is although each dataset will have the same setout, (Date, Amount, Target Amount), each record may have a totally different query (Amount = Tons, Staff Numbers, Downtime, Reject Percent, Customer Complaints from any table in any database that is used to monitor performance).
The idea is for each record in a table to have a query that returns a dataset to use in a graph in the various forms/reports.
I should be able to set the graphs dataset to the appropriate query for each record.
I think I need to construct the query in SQL (or copy the SQL code after building the query the normal way) and insert it in a field as a string, use the string from the field as a variable in VBA to define the query.
something like
Sub WhateverWillHappenToShowGraph()
dim WhatHaveYouBeenDoingAboutIt as string
WhatHaveYouBeenDoingAboutIt = me.QuerySQLString.Value
me.ProgressGraph.Recordset = "'" & WhatHaveYouBeenDoingAboutIt & "'"
me.ProgressGraph.Requery
End Sub
(i know thw syntax will be way wrong, but i dont know it off the top of my head right now)
Does the general drift make sense?
Will it work?
Is there a better way?
Cheers
Mike C
-----------------------------------------------
The only stupid question is the one that goes unasked...
im having a little trouble explaining what i nedd so please bear with me..
What I am essentially trying to do is have a record in a table that includes a query.
The thing is although each dataset will have the same setout, (Date, Amount, Target Amount), each record may have a totally different query (Amount = Tons, Staff Numbers, Downtime, Reject Percent, Customer Complaints from any table in any database that is used to monitor performance).
The idea is for each record in a table to have a query that returns a dataset to use in a graph in the various forms/reports.
I should be able to set the graphs dataset to the appropriate query for each record.
I think I need to construct the query in SQL (or copy the SQL code after building the query the normal way) and insert it in a field as a string, use the string from the field as a variable in VBA to define the query.
something like
Sub WhateverWillHappenToShowGraph()
dim WhatHaveYouBeenDoingAboutIt as string
WhatHaveYouBeenDoingAboutIt = me.QuerySQLString.Value
me.ProgressGraph.Recordset = "'" & WhatHaveYouBeenDoingAboutIt & "'"
me.ProgressGraph.Requery
End Sub
(i know thw syntax will be way wrong, but i dont know it off the top of my head right now)
Does the general drift make sense?
Will it work?
Is there a better way?
Cheers
Mike C
-----------------------------------------------
The only stupid question is the one that goes unasked...