Help With Comment Field

Hello I have a code that will run except for the last record in the query

rivate Sub Remarks7_AfterUpdate()
 Dim rst As DAO.Recordset
   Dim strRemarks As String
   
    strRemarks = Me.Remarks7
    If strRemarks = "" Then Exit Sub
   
   Set rst = CurrentDb.OpenRecordset("Final_Table")
   'strRemarks = Me.Remarks7

   Do While Not rst.EOF
      rst.Edit
        If Nz(rst![BC1Chng7]) <> "" Then
         rst![Remarks7] = strRemarks
      Else
         rst![Remarks7] = Null
      End If
      rst.Update
      rst.MoveNext
   Loop
      

End Sub

Open in new window


HELP!!!
Jass SainiAsked:
Who is Participating?
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
You might try this:

 Do
      rst.Edit
        If Nz(rst![BC1Chng7]) <> "" Then
         rst![Remarks7] = strRemarks
      Else
         rst![Remarks7] = Null
      End If
      rst.Update
      rst.MoveNext
   Loop Until rst.EOF
0
 
Jass SainiAuthor Commented:
Awesome.  It worked
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.