G
Guest
Hi all,
I have a question regarding queries. How can I run a select query in code?
I have a form that gets data from user to determine what information to
query for (ie. all parts, 1 part, time frame, etc). Once the user has made
all the selections and pressed the button to continue, the code recreates an
existing query (used for multiple forms) and then runs another query for a
new form to build a chart. Basically it goes Form > Query > Query > Chart
(in Form)
Now I need to find a way to run both queries within the code and without
having to explicitly run the form.
I found a way to do it using DoCmd.OpenQuery("qryName") but it also opens
the query. Not surprising since it's called OpenQuery. But I can't find a
way to run the queries without opening them. And if I do nothing, and just
base the chart off the queries, it's meaningless. I need to run the queries
if the chart is to be displayed properly.
Any help is appreciated.
Thanks,
Jay
I have a question regarding queries. How can I run a select query in code?
I have a form that gets data from user to determine what information to
query for (ie. all parts, 1 part, time frame, etc). Once the user has made
all the selections and pressed the button to continue, the code recreates an
existing query (used for multiple forms) and then runs another query for a
new form to build a chart. Basically it goes Form > Query > Query > Chart
(in Form)
Now I need to find a way to run both queries within the code and without
having to explicitly run the form.
I found a way to do it using DoCmd.OpenQuery("qryName") but it also opens
the query. Not surprising since it's called OpenQuery. But I can't find a
way to run the queries without opening them. And if I do nothing, and just
base the chart off the queries, it's meaningless. I need to run the queries
if the chart is to be displayed properly.
Any help is appreciated.
Thanks,
Jay