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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command button exprt to excel

Status
Not open for further replies.

cranebill

IS-IT--Management
Jan 4, 2002
1,113
US
I have a report that I run to view status multiple times a day, however this wastes alot of paper. Is there a way to hit a button that will export query results into excel and open there?
 
Have a look at the DoCmd.TransferSpreadsheet method.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
so I tried it and this is what I have:

Code:
DoCmd.TransferSpreadsheet transfertype:=acImport, SpreadsheetType:=5, _
            tablename:="QA_STATUS_REPORT_FINAL", FileName:="SomeExcelFile", _
            Hasfieldnames:=False, Range:="test!A:F"

says field F1 does not exist...

any ideas?
 
Is there a way to hit a button that will export query results into excel and open there?


Code:
DoCmd.TransferSpreadsheet transfertype:=[b]acImport[/b], SpreadsheetType:=5, _
            tablename:="QA_STATUS_REPORT_FINAL", FileName:="SomeExcelFile", _
            Hasfieldnames:=False, Range:="test!A:F"

Are you not trying to export to Excel?

Something like...
Code:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, _
                    "qryYourQuery", "C:\Your Destination", True
 
Why not just have a Button set to 'Print Preview' for your report.

I have all reports go to screen first for checking. Saves lots of paper,

jon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top