Column-names when exporting to a spreadsheet

R

Rob Berkers

Hello everybody,

I have a question about exporting a query to a spreadsheet.

I export the query called "Bushe" with the next statement (and this
works wonderful):

DoCmd.TransferSpreadsheet 1, 8, "Busche",
"G:\Data\Inkoop\Documenten\Export\60585 Bushe.xls", True


But in the spreadsheet that is created all the column names have the
name of the original table-fields. I would like to change them during
the export to something more meaningful for the user who needs this
spreadsheet.

Can this be done?

Thanks in advance.

Rob
 
D

Douglas J. Steele

Create aliases in your query.

Rather than the query looking like

SELECT Field1, Field2, Field3
FROM MyTable

use

SELECT Field1 AS A, Field2 AS B, Field3 AS C
FROM MyTable
 
J

Jeff Boyce

Rob

You don't mention whether you have used "alias" names in your query. What
happens if you keep your current query fields, but prefix each with a
different name, i.e.:
Field1: YourOriginalFirstField Field2: YourSecondTableFieldName
Field3: ...

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/
 
Top