query to update a table from a form

  • Thread starter Thread starter Ernest Forero
  • Start date Start date
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
 
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.
 
Back
Top