Automate transferring fields to an Excel template.

  • Thread starter Thread starter Cindy Grover
  • Start date Start date
C

Cindy Grover

I have an Excel template with 15 headers. I need to move
the fields of the Access recordset to the correct header.
How would I write an array in a module to do this. Also
the records are by region.
 
MDW said:
You'd be better off creating a recordset that selects the
columns in the correct order, then transferring the data
in one big chunk.

No recordset required if you can use a query like this:

INSERT INTO
[Excel 8.0;Database=C:\MyTemplate.xlt;].MyExcelTable
(MyXLCol1, MyXLCol2, MyXLCol3)
SELECT
MyJetCol1 AS MyXLCol1,
MyJetCol2 AS MyXLCol2,
MyJetCol3 AS MyXLCol3
FROM MyJetTable
;

Jamie.

--
 
Back
Top