Working with tables in Excel 2007.
I would do the following:
1.save your query as a stored procedure in the database, with all
parameters needed
2. write a module that gets all parameters from a userform/cells in
spreadsheet/ input boxes
3. connect to the db
3. build the stored procedure string: sp_MyStoredProcedure @param1,
@param2 .....
4. execute (docmd.execute TheString)
5. get data into a recordset
6. drop data to spreadsheet
7. define the region as a Excel table, with chosen format.
Does this help?
Docksi.
|