title: How to reference a combo box in a SQL statement and run the statement in VBA
body: <p>I am attempting to let users use a form to insert data into the table Inventory2Locaton in Microsoft access. They will select data from two combo boxes and then press an add button to add the data to the table.</p>
  
  <p>The query I use is</p>
  
  <pre><code>INSERT INTO Inventory2Location
  VALUES (ComboPart.value, ComboOver.value);
  </code></pre>
  
  <p>but it won't actually pull <code>ComboPart.value</code> or <code>ComboOver.value</code> from the combo boxes.</p>
  
  <p>I also cannot figure out how to run this query by clicking the button. I have the module with</p>
  
  <pre><code>Private Sub CommandAdd_Click()
  </code></pre>
  
  <p>but don't know what VBA code will run the query. </p>
  
  <p>I am quite familiar with VBA from excel experience and have taken a class on SQL but I am very new to access and don't understand how to put the two together.</p>