convert table from access to excel

6

'69 Camaro

Hi, Luis.
I need t creat a bottom to convert a table from access to excel.

May I suggest a button on a form instead? In the button's OnClick( ) event,
paste the following code:

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, "MyTable",
_
"C:\Work\tblStuff.xls", True

Change MyTable to the name of your table and C:\Work\tblStuff.xls to the
path and file name of your spreadsheet. If you want column headers, leave
True as it is, but if you don't want column headers, change True to False.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
 
L

Luis P.

Thanks a Lot, very usefull. great solution.

'69 Camaro said:
Hi, Luis.


May I suggest a button on a form instead? In the button's OnClick( ) event,
paste the following code:

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, "MyTable",
_
"C:\Work\tblStuff.xls", True

Change MyTable to the name of your table and C:\Work\tblStuff.xls to the
path and file name of your spreadsheet. If you want column headers, leave
True as it is, but if you don't want column headers, change True to False.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
 

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