[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


update some fields in one table from another table

Posted on 2011-10-05
Medium Priority
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

ID: 36921664
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 93

Accepted Solution

Patrick Matthews earned 2000 total points
ID: 36921669
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

ID: 36922218
thank you

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

872 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