I believe the above answer is enough but just incase you didnt want the query to actually exist as an object, you could run the SQL statement that the query is running from by using Docmd.RunSQL function
As additional comments, the docmd.openquery works for "select" queries. You can use the RunSql code for action queries such as update, append and make table queries. I insert the debug.print function so that if the SQL string has bugs, I can go to the immediate window and copy the SQL string and paste it into a query for a quick solution to the problem. For us older programmers, that sometimes works better than trying to analyze the text in a long SQL string.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.