Solved

Append to 2 different tables?

Posted on 2011-09-29
7
408 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
  • 3
  • 2
  • 2
7 Comments
 
LVL 75
ID: 36816414
I don't think so with a single query.

mx
0
 
LVL 18

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 - Access MVP) earned 250 total points
ID: 36816474

Just do this:

    CurrentDb.Execute "AppendToTable1", dbFailOnError
    CurrentDb.Execute "AppendToTable2", dbFailOnError
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

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 18

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 18

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

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…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

743 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

15 Experts available now in Live!

Get 1:1 Help Now