Results 1 to 4 of 4
  1. #1
    desiretolearn is offline Novice
    Windows XP Access 2013
    Join Date
    Jun 2014
    Posts
    1

    Appending data using coding..!!

    Hi All,



    Am new to VBA programming. I have a requirement wherin i need to transfer data from two tables in MS-Access to other table in same DB.
    For Ex:

    i have created 3 tables say A B and C, i need to take data from A and B with some criterias and put it in table C.

    Please guys help me out.

    Thanks in Advance..

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Sounds like you want to use an Append Query. See: http://office.microsoft.com/en-us/ac...010076526.aspx
    If you do a Google Search on "Access Append Query", you will find many other links and even YouTube tutorials.

    Also note, you may want to consider if you even really need to do that at all. In many instances, if you can get what you need through a query, there is often no reason to physically write the data back to a data table, especially considering Queries can be used as the Data Source for other Queries, Forms, Reports, and Exports.

  3. #3
    IslandHydro is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2013
    Location
    Whidbey Island, Washington State, USA
    Posts
    21
    For each transfer (A to C, B to C) I'd probably build a SQL string such as this:

    Dim SQL as String
    SQL = "INSERT INTO TableC (FieldA, FieldB) Select TableA.FieldA, TableA.FieldB from tableA Where FieldC = X"

    you can actually build the Query in the query builder, then switch to SQL view to see what it should look like. Then transfer the SQL script into your code, and run it via DoCmd.RunSQL(SQL)

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    How you approach this really depends on what kind of info you're pulling from TableA and TableB to include in TableC. An Append Query might be appropriate, or something as simple as Comboboxes based on TableA and TableB might work.

    A plain language explanation of what you're trying to do would help us help you better.

    Welcome to AccessForums!

    Linq ;0)>

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

Similar Threads

  1. Appending Data from One Record to the Next
    By Greg@Work in forum Access
    Replies: 5
    Last Post: 10-08-2013, 10:14 AM
  2. Replies: 2
    Last Post: 03-14-2013, 08:39 AM
  3. Replies: 5
    Last Post: 12-09-2012, 02:29 PM
  4. Replies: 1
    Last Post: 07-30-2012, 08:07 AM
  5. Replies: 1
    Last Post: 03-29-2012, 06:19 PM

Tags for this Thread

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