Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I have a button on a form export directly to an xls file?

Status
Not open for further replies.
Sep 10, 2002
150
US
And can I have it prompt for the file name? If I can use a default file name, can I have it use today's date Date()?
Thanx!!!!
 
You could put it behind the Click event of your button:

DoCmd.TransferSpreadsheet acExport, "tblYourTable", "FileNameIncludingFullPath.xls", True

I'm not sure about prompting. Maybe someone else can help with that. Ann
 
I am trying to export a report, can I just substitute the Report name instead?
 
Take a look at DoCmd.TransferDatabase acExport ...

I haven't used it much and don't recall all the parameters off the top of my head but you should be able to find it easily enough. Ann
 
This works for exporting a report to excel.

DoCmd.OutputTo acOutputReport, "YourReport", acFormatXLS, "c:\YourFolder\YourFileName.xls"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top