title: Update Table from Query using VBA
body: <p>VBA/Macro newbie needing help with the above mentioned.</p>
  
  <pre><code>Table: Inventory
  
     Product      Value a    Value b
  1. Product 1    0          0
  2. Product 2    0          0
  3. Product 3    0          0
  
  Query: Qry
  
     Product     Value    VAL
  1. Product 1   100      a
  2. Product 2   200      a
  3. Product 3   300      b
  </code></pre>
  
  <p>Result of Marco</p>
  
  <pre><code>Table: Inventory
  
     Product      Value a    Value b
  1. Product 1    100        0
  2. Product 2    200        0
  3. Product 3    0          300
  </code></pre>
  
  <p>Without changing the schema or thinking of alternative methods: I specifically need a macro (not an update query) to update corresponding products in table.field "Inventory.Value" with a value from query "qry" depending on whether it is in column a or column b as stated in the table.</p>
  
  <p>I know that there will be an iif statement involved and a insert into but for the life of me I just cannot make it work.</p>
  
  <p>EDIT: I am open to alternative ideas with the same result.</p>
  
  <p>This is a watered down version of the database.</p>