update some fields in one table from another table

Posted on 2011-10-05
Last Modified: 2012-08-13
have attached sample:
how can i write update statement-to  update Table2 with data from Table1?
The fields in Table2 that are not in Table1 - i want the data to remain in the fields - when it is updated
thank you
Question by:davetough
    LVL 16

    Expert Comment

    You need to join the two tables together via a common key, then you can update a field in the first table with the value from a field in the second table.  In the query designer you would put the field in the 2nd table with square brackets around it in the update section for the first field.
    LVL 92

    Accepted Solution

    UPDATE Table1 INNER JOIN Table2 ON Table1.ID = Table2.ID SET Table2.tname = [Table1]![tname], Table2.tmodel = [Table1]![tmodel], Table2.qty = [Table1]![qty], Table2.tdate = [Table1]![tdate];

    Author Closing Comment

    thank you

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
    Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
    Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
    In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now