+ Reply to Thread
Results 1 to 2 of 2

How do I, in a marco VBA, code to take data from excel and append it to Access?

  1. #1
    Pete
    Guest

    How do I, in a marco VBA, code to take data from excel and append it to Access?

    I would like to appended my excel data to a access database table. I
    can manualy do this but I need to programmatly do it. I also must
    avoid the message "you are about to append ??? records".
    Thanks for your help.


  2. #2
    David Lloyd
    Guest

    Re: How do I, in a marco VBA, code to take data from excel and append it to Access?

    Pete:

    One alternative is to use the QueryDef class of DAO. For example:

    Function RunAppendQuery()
    Dim qdf As QueryDef

    Set qdf = CurrentDb.QueryDefs("MyAppendQuery")
    qdf.Execute

    Set qdf = Nothing

    End Function

    The example assumes that you have saved your append query in Access and that
    you have linked your Excel workbook into Access. You could tie this
    function to the click event of a command button, for instance. You will
    need a reference to the Microsoft DAO library, of course.

    Information on creating an Append query can be found in the following KB
    article (if needed).

    http://support.microsoft.com/default...b;en-us;306093


    --
    David Lloyd
    MCSD .NET
    http://LemingtonConsulting.com

    This response is supplied "as is" without any representations or warranties.


    "Pete" <Pete.Peters@sca.com> wrote in message
    news:1130950973.761018.268280@g14g2000cwa.googlegroups.com...
    I would like to appended my excel data to a access database table. I
    can manualy do this but I need to programmatly do it. I also must
    avoid the message "you are about to append ??? records".
    Thanks for your help.



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1