Solved

Append to 2 different tables?

Posted on 2011-09-29
7
413 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
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

910 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

24 Experts available now in Live!

Get 1:1 Help Now