Access 2010 - execute append query to update 1 table from inputs of two other tables

I have an Access 2010 database with 3 tables (table1, table2, table3). I am trying to execute an Append query that inserts values from both table2 and table3 into table1. The conditions are this:

1 value from table2 (User ID) is inserted into table1 into a field called table1.UserID
46 values (all listed Task entries contained in table3) are to be inserted into a field called table1.TaskNumber

The goal is to have a list of tasks inserted into table1 for each user.
Mark2016Asked:
Who is Participating?
 
PatHartmanConnect With a Mentor Commented:
INSERT INTO tbl3 ( field1, field2)
SELECT Table1.Field1, Table2.Field2
FROM Table1, Table2;

This query does a cross join which produces a Cartesian Product.  Every row in tbl1 is joined to every row in tbl2.

Open the QBE.
Add the two source tables.  Do not draw a join line.
Select the columns you want from each.
Change the query type to Append.
Map the source column names to the target columns if they are not the same.
Save the query.
0
 
Mark2016Author Commented:
If I need to only append table3 with table1 and table2 values where a table1 column is not Yes

How would that alter what you've described?
0
 
bfuchsConnect With a Mentor Commented:
at the end of sql statement just add
where table1.field1 = false (if its a yes/no field)
0
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

 
Mark2016Author Commented:
It's worth noting that the target table for the append query should not be visible/included in the Append Query.
0
 
bfuchsConnect With a Mentor Commented:
Once you change the query to append, it will prompt you to select the target table, and will be displayed in SQL view, why exactly do you also need to see it in design view?
0
 
PatHartmanConnect With a Mentor Commented:
It's worth noting that the target table for the append query should not be visible/included in the Append Query.
I don't know what you are trying to say here.  It is possible to select rows from tblA and then append them to tblA although that is not what you requested.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.