Any ideas on how i can automate the processes via form by have vba execute the queries in sequence and creating output to be exported to excel
Any ideas on how i can automate the processes via form by have vba execute the queries in sequence and creating output to be exported to excel
Something like:
DoCmd.SetWarnings False
DoCmd.OpenQuery "query1 name"
DoCmd.OpenQuery "query2 name"
...
DoCmd.SetWarnings True
'code to export to Excel
Review http://www.accessmvp.com/KDSnell/EXCEL_MainPage.htm
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
If any of these Queries are dependent on the results of a previous Query, you may need to add a DoEvents command between each one.
Access is asynchronous, which is to say, if given a series of commands, it starts to execute one, moves on to the next one and starts executing it, and so forth. It doesn't wait for the first command to be completed before starting the second one, and this can cause timing problems.
DoEvents returns control to Windows, allowing (in the sample below) QueryA to complete running before starting to run QueryB. It then allows QueryB to finish running before starting QueryC, and so forth.
Code:DoCmd.OpenQuery "QueryA" DoEvents DoCmd.OpenQuery "QueryB" DoEvents DoCmd.OpenQuery "QueryC"
Linq ;0)>