Solved

Append to 2 different tables?

Posted on 2011-09-29
7
435 Views
Last Modified: 2013-11-27
Experts,

I am crafting an Append Qry.
I need to Append to 2 different tables.

Is this possible?  I only see a way to select 1 Append to table.

thank you
0
Comment
Question by:pdvsa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 75
ID: 36816414
I don't think so with a single query.

mx
0
 
LVL 19

Assisted Solution

by:Richard Daneke
Richard Daneke earned 250 total points
ID: 36816442
You can use SQL statement OR  set up two append queries and run from VBA or a Macro.
0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 250 total points
ID: 36816474

Just do this:

    CurrentDb.Execute "AppendToTable1", dbFailOnError
    CurrentDb.Execute "AppendToTable2", dbFailOnError
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 

Author Comment

by:pdvsa
ID: 36817626
But hiw would it append to the correct fields?  I need to have this because the fields do not match.

Thx
0
 
LVL 19

Expert Comment

by:Richard Daneke
ID: 36817691
What we are suggesting is to create two append queries.  Design them to append to the fields in the tables as needed.
To use the append queries,
  you can run them individually,  
  you can use BA  code
    CurrentDb.Execute "AppendToTable1", dbFailOnError
    CurrentDb.Execute "AppendToTable2", dbFailOnError
  or you can create a macro to run the two queries.
You have an operational question on how to run two append queries and not a coding question on how to append to two tables.
Access desing mode will restrict you to append records to only one table.
0
 
LVL 19

Expert Comment

by:Richard Daneke
ID: 36817718

Correcting spelling mistakes:
What we are suggesting is to create two append queries.  Design them to append to the fields in the tables as needed.
To use the append queries:
  you can run them individually,  
  you can use VBA  code
    CurrentDb.Execute "AppendToTable1", dbFailOnError
    CurrentDb.Execute "AppendToTable2", dbFailOnError

  or you can create a macro to run the two queries.
You have an operational question on how to run two append queries and not a coding question on how to append to two tables.
Access query design view will restrict you to append records to only one table (which must already exist).
0
 

Author Closing Comment

by:pdvsa
ID: 36817927
Ahhhh... I get it. Was analyzing it too much.  Thx
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Familiarize people with the process of utilizing SQL Server stored procedures 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 Micr…
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…

749 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