Hi, I could really use some help here. I'm trying to tighten up a DB that has lots of queries that are fired in VBA by using some like this:
I might be wrong, but this seems rather inefficient and I'd like to use more SQL statements in VBA. It's easy enough to copy the SQL from the saved query, assign it to a string variable and run it. The obstacle I have is the SQL code is often very, very long and I'd like to use line breaks and table aliases to compress the code and neaten it up.
I've attached a text file to show the full extended version of the code.
Any help or suggestion would sincerely be appreciated.
Thanks,
Ed
Code:
strQuery = "the query to be run"
DoCmd.OpenQuery strQuery
I might be wrong, but this seems rather inefficient and I'd like to use more SQL statements in VBA. It's easy enough to copy the SQL from the saved query, assign it to a string variable and run it. The obstacle I have is the SQL code is often very, very long and I'd like to use line breaks and table aliases to compress the code and neaten it up.
I've attached a text file to show the full extended version of the code.
Any help or suggestion would sincerely be appreciated.
Thanks,
Ed