title: Edit, update record with DAO.Recordset
body: <p>I have two tables <code>Table1</code> and <code>Table2</code>. In <code>Table1</code> there is Column called <code>FileID</code> and <code>Table2</code> there is column  called <code>FileID</code>.  Now <code>FileID</code> is not unique, so there are certain rows where <code>FileID</code> is repeated in both tables. 
  I have a Form in Access, where there is field called <code>GetDate</code> from <code>Table1</code>.
  I need something in vba that if you make changes to the <code>GetDate</code> part on the form (which is from <code>Table1</code> table) then it should update column <code>Date</code> with the current date and Time which is in <code>Table2</code></p>
  
  <p>I did it the following way. But its updating only the first record of <code>Date</code> From <code>Table2</code> with current time and not the second one with <code>FileID = 1</code>. 
  there are two records for <code>FileID = 1</code>, in <code>table2</code> so it should update 2 records with current date and not one.
  here is my code for it. </p>
  
  <pre><code>Option Compare Database
  
  Private Sub GetDate_AfterUpdate()
  Dim dbs As DAO.Database
  Dim rst As DAO.Recordset
  ' Dim rst2 As DAO.Recordset
  
  
  Set dbs = CurrentDb
  Set rst = dbs.OpenRecordset("SELECT  [GetDate], [DATE] FROM Table1 INNER JOIN Table2 ON Table1.ID = Table2.ID2 where Table1.FileID = Table1.FileID", dbOpenDynaset)
  'Begin row processing
  Do While Not rst.EOF
  rst.Edit
  rst![Date] = Now
  rst.Update
  rst.MoveNext
  Exit Do
  
  Loop
  
  
  
  rst.Close
  Set rst = Nothing
  
  
  End Sub
  </code></pre>
  
  <p>thanks for the help! </p>