On Error GoTo errMsg
Dim strSql As String
Set db = CurrentDb()
strSql = "Select * From Test"
Set rsChild = db.OpenRecordset(strSql)
If rsChild.RecordCount <> 0 Then
rsChild.MoveFirst
Do While Not rsChild.EOF
With rsChild
MsgBox .Fields("comments").Value
.Edit
.Fields("comments").Value = "comments"
.Update
MsgBox .Fields("comments").Value
End With
rsChild.MoveNext
Loop
End If
rsChild.Close
Set rsChild = Nothing
db.Close
Set db = Nothing
Exit Sub
errMsg:
On Error Resume Next
rsChild.Close
Set rsChild = Nothing
db.Close
Set db = Nothing
MsgBox "错误:" & Err.Description
Exit Sub