View Full Version : command buttons


DrRocket
06-19-2001, 01:22 PM
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?

jimbrooking
06-20-2001, 07:22 AM
Check out the OutputTo Action (or the OutputTo method of the DoCmd object).

Talismanic
06-20-2001, 09:44 AM
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.