View Full Version : Transfer Spreadsheet - Use Captions Not Filenames


dazstarr
03-10-2009, 02:59 AM
Can someone advise me how to use Captions and not Access actual fieldnames when transferring a query into Excel please?

I have the following line of code which exports the query - it works fine but I need it to use captions instead of the fieldnames.

/code
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "qryMMSpreadsheetReport", "J:\EDIMIS\Exclusions\Daz_Test.xls", True
\code

Many Thanks in advance.
Daz

DCrake
03-10-2009, 03:57 AM
Design your query and use alias names in your column headings for the actual field names you want to see in Excel.

dazstarr
03-10-2009, 03:59 AM
Thanks for replying.

Is there no way I can point the code to use the captions instead?

The database is huge and has lots of code in different places and would rather leave the query and table as it is.

Thanks
Daz

dazstarr
03-10-2009, 04:02 AM
Sorry I think I mis-understood your thread.

Do you mean EG:

FullPupilName
Pupil Name: FullPupilName

Thanks
Daz

dazstarr
03-10-2009, 04:13 AM
Sorted it - I did as above.

Thanks for your help.

Daz

DCrake
03-10-2009, 04:13 AM
Yes that's correct