Results 1 to 2 of 2
  1. #1
    tariq nawaz is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Aug 2012
    Posts
    31

    export access table by using VBA code.

    first of all i introduce. i am a novice and doing one very small application in access using VBA.
    i have a table called "input" in a file called "book1"and i can export it using the code.

    DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "input", "z:\Book1.xls", False, "Sheet1$"



    it works fine as it exports the data.
    i have couple of problems if someone could help me with that it will be great.

    1. whenever it exports the data it makes the same number of blanks where the old data file was.
    so after exporting few times there are hell of blank lines on top.
    2. when i export data it exports all the data as "Text" format but i have few items as number in my access table.
    is there a way that i can export the data in the same format as the actual table in access is.
    3. anyway i can email the table to myself using VBA code.

    as i mentioned i am new to Access databases and VBA . help will be much apreciated.

    Regards

    A learner

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,963
    1. Odd, are there a bunch of 'blank' records in the dataset?

    2. The import/export wizard has a setting for this. Perhaps if you save an export specification and use that specification with RunSavedImportExport method.

    Want to provide db for analysis? Follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 08-05-2012, 06:32 PM
  2. export Access table as .csv
    By Nancy in forum Import/Export Data
    Replies: 1
    Last Post: 02-13-2011, 04:09 AM
  3. Replies: 1
    Last Post: 08-12-2010, 10:04 PM
  4. Need Helpto Export Access Table to .txt type SDF
    By Kishwar in forum Import/Export Data
    Replies: 2
    Last Post: 05-17-2010, 10:07 AM
  5. Export Access Pivot Table to Excel
    By graviz in forum Programming
    Replies: 1
    Last Post: 11-13-2009, 07:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums