i try to update multiple records in a table using the subsequent code
when I press the button, the code runs perfectly and updates the records. the funny think happens when i close the form. Then, the first record of the table changes.
Probably, i miss something :(
"Private Sub cmdChange_Click()
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim sqlstrQuarantors As String
Dim i As Integer
i = 0
Dim Guarantor As String
Dim NumofGuarantors As Integer
Set db = CurrentDb
sqlstrQuarantors = " Select * from tblguarantors where GuarantorId = '" & Me.GuarantorId.Value & "'"
Set rst = db.OpenRecordset(sqlstrQuarantors)
Do While Not rst.EOF
If rst!GuarantorId = Me.GuarantorId.Value Then
rst.Edit
rst!GuarantorName = Me.GuarantorName.Value
rst.Update
i = i + 1
End If
rst.MoveNext
Loop
rst.Close
End Sub "