We help IT Professionals succeed at work.

Help With Comment Field

Jass Saini
Jass Saini asked
on
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!!!
Comment
Watch Question

Database Architect / Application Developer
Top Expert 2007
Commented:
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

Author

Commented:
Awesome.  It worked