J
Jayson
For each occurance of a record in a particular table, I
want to execute a macro.
The macro executes a SQL query and using the OutputTo
method, outputs the results to an Excel file.
The SQL query takes an argument.
For the macro, the name of the Excel file needs to be
supplied.
I want to execute the macro and pass the argument for the
query and the Excel file name.
Does anyone know how to do this?
I have created a VBA module that I think will do this, but
I don't know how to execute it.
Option Compare Database
Option Explicit
Public Sub Create_Excel_Input_Tables(CSU)
For Each CSU In CSU_List_Table
DoCmd.OutputTo acOutputQuery, Input(CSU,
CSU_Inputs), acFormatXLS, CSU_Inputs, 0
Next
End Sub
Thanks
want to execute a macro.
The macro executes a SQL query and using the OutputTo
method, outputs the results to an Excel file.
The SQL query takes an argument.
For the macro, the name of the Excel file needs to be
supplied.
I want to execute the macro and pass the argument for the
query and the Excel file name.
Does anyone know how to do this?
I have created a VBA module that I think will do this, but
I don't know how to execute it.
Option Compare Database
Option Explicit
Public Sub Create_Excel_Input_Tables(CSU)
For Each CSU In CSU_List_Table
DoCmd.OutputTo acOutputQuery, Input(CSU,
CSU_Inputs), acFormatXLS, CSU_Inputs, 0
Next
End Sub
Thanks