title: VBA: Insert ascending Date in Table
body: <p>I'm trying to simplify the input by users with a code. It's difficult to explain the process so I show you what I mean.</p>
  
  <p>The user only has to Input the following values:</p>
  
  <p><strong>Event</strong>: <code>event1</code>   <strong>From</strong>: 01.01.2017   <strong>To</strong>: <code>01.04.2017</code>   <strong>Cost</strong>: <code>5000</code></p>
  
  <p>Result in the Table:</p>
  
  <pre><code>event1   01.01.2017   5000
  event1   01.02.2017   5000
  event1   01.03.2017   5000
  event1   01.04.2017   5000
  </code></pre>
  
  <p>I tried it with this code:</p>
  
  <pre><code>Private Sub Save_Click()
  
  Dim strSQL As String
  Dim Period As Date
  
      For Period = "' &amp; Me!FromDate &amp; '" To "' &amp; Me!ToDate &amp; '"
  
      strSQL = "INSERT INTO tblEvents (EventName, Date, Costs) VALUES ('" &amp; Me!EventName&amp; "' , '" &amp; Date &amp; "', '" &amp; Me!Costs&amp; "')"
      CurrentDb.Execute strSQL
  
      Next Date
  
  End Sub
  </code></pre>