query to update a table from a form

E

Ernest Forero

I created two tables, Products and Purchases, where the common key
field is PRODUCT_ID. I created the relationship between these two
tables and an action query to update the PRoducts table Units in Stock
field by adding Purchases.no_units_purchased to
Products.Units_in_Stock. The problem is that the query updates all
the rows and I want to update only the record being worked on. What
am I doing wrong?? Please help..

Thanks in advance.......
Ernest
 
R

Rick Brandt

Ernest Forero said:
I created two tables, Products and Purchases, where the common key
field is PRODUCT_ID. I created the relationship between these two
tables and an action query to update the PRoducts table Units in Stock
field by adding Purchases.no_units_purchased to
Products.Units_in_Stock. The problem is that the query updates all
the rows and I want to update only the record being worked on. What
am I doing wrong?? Please help..

Look at your update query, especially the criteria rows. Do you have any
criteria entered? If not then the query will affect every row. You need to add
criteria that references the primary key of the record on your form. Then only
that row will be updated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top