Automate transferring fields to an Excel template.

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.
 
J

Jamie Collins

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.

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top