title: Calculated field with value from another table in Microsoft Access
body: <p>I have a calculated field in a table that needs to take the value from another table but in the expression generator window it doesn't allow me to choose values from other tables.
  Then, I tried to create a form from the table, and put in the source control the function that I need but it triggers a <code>#Name?</code> Error in the form.</p>
  
  <p>This is the code that I put in the source control (Iff function) :</p>
  
  <pre><code>=IIf([Stato]="Vendita";[Costo ivato 1 pezzo]+(([Costo ivato 1 pezzo]/100)*[Provv_Vendita]![Costo]);[Costo ivato 1 pezzo]+(([Costo ivato 1 pezzo]/100)*[Provv_Prevendita]![Costo]))
  </code></pre>
  
  <p><code>[Stato]</code> and <code>[Costo ivato 1 pezzo]</code> are two fields that are in the same table (called <code>Prodotti</code>) that is structured like this:</p>
  
  <pre><code>Stato      Costo Ivato 1 pezzo
  
  Vendita         10
  Prevendita      20
  </code></pre>
  
  <p>The other table (called <code>Provvigioni</code>) is like</p>
  
  <pre><code>Tipo        Costo
  
  Vendita       1,5
  Prevendita    5
  </code></pre>
  
  <p><code>Provv_Vendita</code> and <code>Provv_Prevendita</code> are two queries that select the values that I need and are structured like this</p>
  
  <pre><code>SELECT Provvigioni.Costo
  FROM Provvigioni
  WHERE Provvigioni.Tipo="Vendita";
  </code></pre>
  
  <p>Is there a way to take the field from the other table and use in a function on the first table?</p>