I want to execute a predefined query from access via VBA and print it to the debug output. The name of the query design is in a variable named report.
I was expecting that it would work with:
debug.print db.Execute report
But everytime vba autocorrects it to:
debug.print db.Execute; report
If I understand it correctly, the ; stands for a new line and makes therefore no sense in my case. But in both cases, with and without the new line I get an error. I assume that the simple problem is, that this is not the right syntax.
I could find a lot of information about how to debug print a query that is created as a string in VBA, but I can't find any hints how to output a query that is predefined in Access via a query design.