title: Creating an SQL query in MS Access for a dropdown box lookup in a subform?
body: <p>I have the following two tables, the first called Projects and the second called Parts:</p>
  
  <p><img src="https://i.stack.imgur.com/LUy0s.jpg" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/SPQHK.jpg" alt="enter image description here"></p>
  
  <p>I then have a form (lets call it Form 1) that uses Projects as its Record Source with a subform that links Project on the Projects table to Project on the Parts table and displays only the items associated with the selected Projects record source, like so:</p>
  
  <p><img src="https://i.stack.imgur.com/9gTvq.jpg" alt="enter image description here"></p>
  
  <p>Now, what I'd like to be able to do is have a dropdown on Form 1 that only has the Items listed on the subform selectable, but I can't seem to find the SQL code to do this.</p>
  
  <p>My current dropdown uses the following code, but of course this just shows all items, not the ones only on the subform:</p>
  
  <pre><code>SELECT [Parts].[ID], [Parts].[Item] FROM Parts ORDER BY [Item]; 
  </code></pre>
  
  <p>What I'd like to do would be like this I think, but obviously using the correct syntax:</p>
  
  <pre><code>SELECT [Parts].[ID], [Parts].[Item] WHERE [Parts].[ID]= &amp; Me![ID]  FROM Parts  ORDER BY [Item]; 
  </code></pre>