Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2005
    Posts
    55

    Unanswered: Transfering data

    Hi! so I got something to work with the copying of data from access to an excel file.

    What is happening is that to every time I click on the export button on my database form to transfer the data to the excel file it writes over the information that exist in the excel file rather than adding to the file. Something like replacing what is there!

    I do not want to replace what is there.I want the data transfer to just add to what is already in the excel file.

    This is the code I used that is working to an extent!

    Private Sub cmdexport_Click()
    DoCmd.OutputTo acOutputQuery, "testquery", "MicrosoftExcel(*.xls)", "C:\Appenddata.xls", False, ""
    End Sub

    Is there a way that I can do this?

    Thanks for any help given.
    Last edited by Greenway; 09-19-06 at 11:24.

  2. #2
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,418
    Provided Answers: 7
    The outputto replace the data so
    think you need to look at the query "testquery" and find out how what that is doing with the data
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  3. #3
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    DoCmd.OutputTo doesn't have a parameter to append the outputted data to the Excel file, so I would look at Importing the current Excel data and appending it to your table in Access, then doing the DoCmd.OutputTo thing with all the data.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

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