command buttons

  • Thread starter Thread starter DrRocket
  • Start date Start date
D

DrRocket

Guest
hi, ive created a form in access in which when the command button is pressed, i need access to take all of that information and dump it into an excel worksheet, i tried using a macro to do that by using the transferspreadsheet command but that doesnt work, does anyone know what exactly i am doing wrong and can someone please tell me how to get a command button to do such an action?
 
Check out the OutputTo Action (or the OutputTo method of the DoCmd object).
 
This should do it for ya:

DoCmd.TransferSpreadsheet acExport, 8, "TableName", "C:\FileName", True

All you need to do is use your table's name in place of "TableName" and then set your file name and path by modifying C:\FileName.
 

Users who are viewing this thread

Back
Top Bottom