Need help with Queries

kyle18

New member
Local time
Today, 15:32
Joined
Aug 12, 2011
Messages
9
Hi, to everyone. I am new in forum, but hope that I can find so needed help hear.
I relatively new to the Access, but until know managed to create quite a useful database. Basically it is a Price list which contains information about goods which my company is buying/selling: (Code, Description, Sales Price, Purchasing Price, Pictures, etc.)

I have problem with two tables:
tblArticle (contains information about Goods)
tblPrice (contains prices)
They are connected with ArticleID.(see attachment)

tblArticle is a table which I fill in manually. Then I import all kind of information from xls (description, purchasing prices, etc.). Then using queries i calculate my import and wholesale prices, and then I copy them into tblPrice, to store them there and use for price offers.

The problem which I have is that when I use an update query it updates tblPrice only if it already contains any value corresponded to value in tblArticle, but what I want, is that it actually create a new record in tblPrice, which corresponds to tblArticle.

Hope that I managed to explain the problem.
Thanks in advance.
 

Attachments

  • Access Print Screen.jpg
    Access Print Screen.jpg
    98.1 KB · Views: 115
You might want to try these steps

1) use the unmatched query wizard to find all records in one table that isn't in the other...
2) Create a make table query, using your unmatched query as the basis for it
3) set up a query similar to the one in your jpg to make the appropraite changes to the table you just made
4) create an append query which will update the Price table with all the "missing" records.

GL,
Gary
 
Thanks for help,

Your hits gave me a clue where to look, so I did Append Query:

INSERT INTO tblPrice (ArticleID)
SELECT tblArticle.ArticleID
FROM tblArticle LEFT JOIN tblPrice On tblArticle.ArticleID = tblPrice.ArticleID
WHERE (((tblPrice.ArticleID) is Null));

Works like charm.

Thanks for help. Good to have such a fast replies.
 

Users who are viewing this thread

Back
Top Bottom