title: Access VBA - Add new row in a subform on
body: <p>I hope someone here can help me! :) Actually I've run into a wall with my VBA recently. I try to made a search form to find some specific field in the Access database. I successfully receive the information I need (Name, place, etc) from a SQL query but when I try to put all of this into a subform, I fail. I find the code below on internet and, execept the fact that the program don't crash, it does absolutly nothing. My really problem (I think) is that I don't know the right synthax to add value after the "addNewRecord".</p>
  
  <pre><code>Set dbs = CurrentDb
  
  WriteToATextFile (sqlquery)
  Set rst = dbs.OpenRecordset(sqlquery)
  
  
  rst.MoveFirst
  Do While Not rst.EOF
  
     If Me!sfrm_recherche_cours.Form.Dirty Then
          Me!sfrm_recherche_cours.Form.Dirty = False
      End If
  
      Me!sfrm_recherche_cours.SetFocus
      MsgBox rst!titre_cours
      DoCmd.GoToRecord , , acNewRec
      txt_sigle_cours = rst!sigle_cours
      txt_titre_cours = rst!titre_cours
      txt_nrc_cours = rst!titre_cours
      txt_faculte_cours = rst!faculte_cours
  
  
     rst.MoveNext
  Loop
  </code></pre>
  
  <p>I try to find something on this site that looks like my problem but I've got nothing...so, if you can put me on the right way, I will be very happy:)</p>