I seem to be going round in circles trying to get this to
work. Here is the prblem afresh.
1. tblstock has (in addition to others) three columns
discount,label,type there are many occurences of the
label+type combination across the 50000 records
2. tbldiscount has been created to give only unique
label+type occurrences and uses the same three columns.
which is used by a form to assign unique discounts to
unique labels+type combinations.
what I want it to do using tbldiscount as the source is
check the tblstock and amend the discount where the
labels+type combination are the same.
I've asked this before; I'll ask it again.
WHY ARE YOU STORING DATA REDUNDANTLY?
It's bad design. It's making your job harder. It's not necessary. You
can create a Query joining tblStock to tblDiscounts, joining by Labels
and Type, and pick up the discount whenever you need it!
But... to answer your question...
Be sure that tblDiscount has a two-field primary key (a key icon on
Label and Type - ctrl-click the two fields and click the Key icon if
it doesn't have this).
Create a Query joining tblDiscount to tblStock; if Access doesn't
automatically join on both fields, manually drag tblDiscount.Labels to
tblStock.Labels and tblDiscount.Type to tblStock.Type.
Change the query to an Update query; on the UpdateTo line under
tblStock.Discount type
[tblDiscounts].[Discount]
Run the query.
You will now have two values of Discount for each value of Labels and
Type - one in each table; right now they'll be the same, but there is
no protection against having one of them changed.