title: How to insert values into the database table using VBA in MS access
body: <p>I've started to use access recently. I am trying to insert a few rows into the database; however, I am stuck as it is throwing an error: </p>
  
  <blockquote>
    <p>Too few parameters.</p>
  </blockquote>
  
  <p>I have a table test with only one column in it named start_date I want to insert all the dates between two dates for example if I consider 1/7/2014 to 3/7/2014 I need dates as 1/7/2014,2/7/2014,3/7/2014 in my table, but I have problem inserting the code I used is as follows </p>
  
  <pre><code>Private Sub createRec_Click()
  Dim StrSQL As String
  Dim InDate As Date
  Dim DatDiff As Integer
  Dim db As database
  InDate=Me.FromDateTxt
  'here I have used a code to find out the difference between two dates that i've not written
  For i = 1 To DatDiff
  StrSQL = "INSERT INTO Test (Start_Date) VALUES ('" &amp; InDate &amp; "' );"
  StrSQL = StrSQL &amp; "SELECT 'Test'"
  db.Execute StrSQL
  db.close
  i=i+1
  next i
  End Sub
  </code></pre>
  
  <p>My code throws an error in the line Db.Execuite StrSQL 
  as too few parameters.
  Hope somebody could help me with this issue.
  Thanks In advance</p>