A
alex
Hello all,
using Access '03...
Thanks to the help of this group, I have some VBA code to export the
results of a Query to Excel.
Dim Where As String
Where = InputBox("Path and File Name")
If Right(Where, 4) = ".xls" Then
Else
Where = Where & ".xls"
End If
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97,
"200805_Report", Where, True
Unlike a Form, however, which I coded before; i'm lost on how to code
a Query to spit its results to Excel upon execution; i.e., perform the
VBA code when I double click on the query without using a switchboard
or other command button.
Where can I place this code (or other code) to run when a query loads/
executes?
Thanks,
alex
using Access '03...
Thanks to the help of this group, I have some VBA code to export the
results of a Query to Excel.
Dim Where As String
Where = InputBox("Path and File Name")
If Right(Where, 4) = ".xls" Then
Else
Where = Where & ".xls"
End If
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97,
"200805_Report", Where, True
Unlike a Form, however, which I coded before; i'm lost on how to code
a Query to spit its results to Excel upon execution; i.e., perform the
VBA code when I double click on the query without using a switchboard
or other command button.
Where can I place this code (or other code) to run when a query loads/
executes?
Thanks,
alex