I’m trying to use the rsRen as the recordset that needs to be modified, so my Where clause if you will.
rsNote is the table with the Notes memo field that requires a strNote to be added to the existing contents.
What is happening is it is modifying only a single record, and one that is not within the rsRen recordset. The way it is modifying the record is also wrong as it is adding the strNote to this single record equal to the number of records in the rsNote recordset.
If I use !Notes = strNote instead, then it clears the Notes field and replaces it with the strNote.
Private Sub cmdTest_Click() Dim db As Database Dim rsRen As Recordset Dim rsNote As Recordset Dim strSQL_Ren As String Dim strSQL_Note As String Dim strNote As String Set db = CurrentDb strNote = “testing 3” strSQL_Ren = GetSQL Set rsRen = db.OpenRecordset(strSQL_Ren) rsRen.MoveLast rsRen.MoveFirst MsgBox “There are: ” & rsRen.RecordCount strSQL_Note = “Select * From tblCompanyContacts” Set rsNote = Nothing Set rsNote = db.OpenRecordset(strSQL_Note) rsNote.MoveLast rsNote.MoveFirst MsgBox “There are: ” & rsNote.RecordCount Do While Not rsRen.EOF With rsNote .MoveLast .MoveFirst Dim strOldNote As String strOldNote = rsNote!Notes .Edit !Notes = strNote & strOldNote .Update Debug.Print strNote, ContactName End With rsRen.MoveNext Loop End Sub
Thank you,
Ken