Results 1 to 6 of 6
  1. #1
    Lounger
    Join Date
    Nov 2003
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Access 2003 doCmd.Transfer Spreadsheet

    Hi I am having difficulty exporting a table called Tbl_Data_Gaps into a folder as an Excel 2003 file to J:\Data Analysis\Gap using an on-click event and the DoCmd.TransferSpreadsheet method - can anyone help? Seems to only offer an import and doesn't like the way I'm defining the route to place the file (I've tried "", [] and () to contain the file name). Can anyone help??

    Much obliged.

    blitzy

  2. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Blitzy,

    Could you please post the code for the On-Click Event?
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  3. #3
    Lounger
    Join Date
    Nov 2003
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by RetiredGeek View Post
    Blitzy,

    Could you please post the code for the On-Click Event?
    HI AS REQUESTED THANKS!

    DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, Tbl_Data_Gaps, [J:\Data Analysis\Gap.xls], True

  4. #4
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Blitzy,

    Try: DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, "Tbl_Data_Gaps", "J:\Data Analysis\Gap.xls", True

    Here a link to the MSDN Help page for TransferSpreadsheet.
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  5. #5
    Lounger
    Join Date
    Nov 2003
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi as per my first email, have already tried in quotations... no worries will keep trying. thanks.

  6. #6
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Blitzy,

    I just ran a test using Access 2003 using this command:
    docmd.TransferSpreadsheet acExport,acSpreadsheetTypeExcel8, "Contracts","G:\BEKDocs\Excel\Test\ExportTest. xls"
    and it worked for me. Please note the Table name {Contracts} is in quotes.
    Attached Images Attached Images
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •