Solved

Append Query

Posted on 2013-06-12
4
590 Views
Last Modified: 2013-06-12
I have a database that I need to run an append query from tblparts to tblworkordersub.  I have it working, the only problem is I need it to also append some of the textboxes from frmworkordersub.  I can not think of how to do this.  I have done this before many years ago, but can not remember what database app I did it in or how I did it.  So any help would be greatly appreciated!
Thanks in advance
Russell
0
Comment
Question by:russell12
  • 2
4 Comments
 
LVL 17

Expert Comment

by:Kent Dyer
ID: 39242594
In Access, isn't there a Query Wizard?  Or Append Wizard that does this for you?

Technically, in SQL, it is called an INSERT INTO Query..

HTH,

Kent
0
 
LVL 2

Author Comment

by:russell12
ID: 39242607
Yes and I have done that this is the outcome:
INSERT INTO tblworkordersub ( Part, PartDollars, Labor, LaborDollars, Catagory )
SELECT tblparts.Part, tblparts.PartDollars, tblparts.Labor, tblparts.LaborDollars, tblparts.Catagory
FROM tblparts
WHERE (((tblparts.SercviceCode)=[Forms]![frmworkorder]![frmsubworkorder].[Form]![Catagory]));
But the problem is I need to insert 5 more fields into tblworkordersub that will come from the form frmsubworkorder.
This append query does work, but it is not carrying over the techs name, id, etc.  All that will come from the form frmsubworkorder.
0
 
LVL 92

Accepted Solution

by:
Patrick Matthews earned 500 total points
ID: 39242643
Kent,

While the actual SQL statement used is indeed INSERT INTO, in the Access UI it is referred to as an "append query".

:)

russell12,

Have you tried:

INSERT INTO tblworkordersub ( Part, PartDollars, Labor, LaborDollars, Catagory,
tech_name )
SELECT tblparts.Part, tblparts.PartDollars, tblparts.Labor, tblparts.LaborDollars, tblparts.Catagory, [Forms]![frmworkorder]![frmsubworkorder].[Form]![tech_name]
FROM tblparts
WHERE (((tblparts.SercviceCode)=[Forms]![frmworkorder]![frmsubworkorder].[Form]![Catagory]));

Open in new window


Patrick
0
 
LVL 2

Author Closing Comment

by:russell12
ID: 39242675
Patrick,
THANK YOU!!! I have been messing with this for 2 hrs trying to find my old db and trying to write it! Thanks a lot!!
Russell
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Access 2016 - Query Challenge 15 51
add more styles to my code 2 19
Help with SQl and UNION 3 19
select over clause 1 0
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

760 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

22 Experts available now in Live!

Get 1:1 Help Now