I come again to the Well of Knowledge...
Just a question, actually. Since moving our SQL backup from an on-prem SQL Server to Azure SQL, the performance of our Access front-ends has slowed dramatically. We were warned and expected this to be an issue. However, I was not expecting VBA processing to create completely wacko results randomly.
As a example, I have queries that gets run during the generation of a report. When I view the query manually, I see the results I was expecting. However, when that same query is executed as a part of a VBA Sub (DoCmd.OpenQuery), I get no records. I have also replaced the same query within the Sub as a DB.Execute statement; still no love. I can't explain this.
I have had similar issues with other queries, whether executed using DB.Execute or as a DoCmd.OpenQuery, that produce different results, sometimes correct results, some completely out of left field (no results, partial results, etc).
What I have learned is that by putting a one-second delay after the query, most queries produce correct results. Some still do not, though.
Is it possible that queries in Access are executed asychronously? Meaning a query is launched and executed while the VBA code continues without waiting for the query to complete. Because this is what it all looks like.
The complete randomness (sometimes it works, sometimes it does not) makes this one difficult to diagnose.
Ken
Just a question, actually. Since moving our SQL backup from an on-prem SQL Server to Azure SQL, the performance of our Access front-ends has slowed dramatically. We were warned and expected this to be an issue. However, I was not expecting VBA processing to create completely wacko results randomly.
As a example, I have queries that gets run during the generation of a report. When I view the query manually, I see the results I was expecting. However, when that same query is executed as a part of a VBA Sub (DoCmd.OpenQuery), I get no records. I have also replaced the same query within the Sub as a DB.Execute statement; still no love. I can't explain this.
I have had similar issues with other queries, whether executed using DB.Execute or as a DoCmd.OpenQuery, that produce different results, sometimes correct results, some completely out of left field (no results, partial results, etc).
What I have learned is that by putting a one-second delay after the query, most queries produce correct results. Some still do not, though.
Is it possible that queries in Access are executed asychronously? Meaning a query is launched and executed while the VBA code continues without waiting for the query to complete. Because this is what it all looks like.
The complete randomness (sometimes it works, sometimes it does not) makes this one difficult to diagnose.
Ken