title: Trying to UPDATE INTO using SQL statement from Excel VBA without success
body: <p>I am trying to insert a new row, populated with data, into a simple Access Table using SQL from Excel VBA and can't get over the first hurdle.</p>
  
  <p>I have a single Table called "Test" with four fields;</p>
  
  <ul>
  <li><p>ID [an AutoNumber field identified as the Primary Key]</p></li>
  <li><p>Text1 [A text field]</p></li>
  <li><p>YN1 [A Yes/No field]</p></li>
  <li><p>No1 [A Long Integer numeric field]</p></li>
  </ul>
  
  <p>There are no relationships or no indexes set other than in the AutoNumber field (PK).
  All fields have 'Required' set to No, no validations set and no defaults set.
  Text1 can accept zero length.</p>
  
  <p>The business end of my VBA code is as follows:</p>
  
  <pre><code>'Connection string.
      stcnt = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" &amp; stDBPath &amp; stDBname
  
  'Instantiate the ADO-objects
      Set cnt = New ADODB.Connection
  
  'Open the connection for first Query
      With cnt
          .Open (stcnt) 'Open the connection.
          .CursorLocation = adUseClient 
  
  'Test Data
  T1 = "ABC123"
  Y1 = -1
  N1 = 17
  
          stSQL1 = "INSERT INTO Test(Text1, YN1, No1) " _
                  &amp; "VALUES(T1, Y1, N1)"
  
          .Execute (stSQL1)
  
      End With
  
      'Close connection
      cnt.Close
  </code></pre>
  
  <p>My variables have been Dimmed appropriately (Y1 as Boolean) and the path/database names declared correctly.</p>
  
  <p>At the line</p>
  
  <pre><code> .Execute (stSQL1)
  </code></pre>
  
  <p>I am getting an error <strong>"No value given for one or more required parameters"</strong></p>
  
  <p>I have read that you can omit the AutoNumber field and its value (which I have done).
  If not, could someone please give me the syntax to include this.
  With my limited knowledge/research I may also not be treating the ‘YesNo’ field properly.
  Again any advice and syntax to deal with this would be gratefully received.</p>
  
  <p>The Access database is sitting on my hard drive and I get the same error irrespective of whether Access is open or closed when running the VBA code.</p>
  
  <p>My SQL statement pasted directly into the Access ‘SQL View’ window runs fine and inserts a correctly populated row in the Table Test.</p>
  
  <p>Any help from an expert (especially with correct syntax) to get me over this one would be much appreciated please.</p>