There are several solutions for your problem. May be the most suitable is using VBA code. But I will try to find a solution using only SQL statements.
First, create a cross reference query called qryChanges from the prices table using the storeID as row grouping and Item Code as column group. Select the column names in the query parameters form to include all the available item codes, something like "Item1","Item2","Item3" ... The value is the first price.
The result of this query will be like:
StoreID Item1 Item2 item3 item 4
27 1.89 3.99
28 3.19 1.41 8.19
Then create another query, as an update query to update table stores. This one uses the table Stores and the previous query qryChanges. Relate them by using the StoreId field. Then for each item, update it by using:
for item1
iif(isnull(qryChanges.Item1),StoreId.Item1,qryChanges.Item1)
for item2
iif(isnull(qryChanges.Item2),StoreId.Item2,qryChanges.Item2)
Summarizing, If the qryChanges contains a null, get the previous value, if not use the new.
Regards,
Jose