Appending in memo field

Danielf

Registered User.
Local time
Today, 15:11
Joined
Feb 21, 2000
Messages
103
I would like to append all the records of
one field based on a query to a memo field in
a table.
Each record should come in a new line.
I have no idea how to do this.


Thanks for help

Daniel
 
Try this:

Public Sub AppendToMemo(byval stCriteria as string)
Dim stRecords as String
dim rstDataFrom as recordset '(Dao.Recordset for 2000)
dim rstDataTo as Recordset '(See above note)

Set rstDataFrom = Currentdb.OpenRecordset("Select [Field1] from [tblData] where [Something] = " & stCriteria, dbOpenSnapShot)
rstDataFrom.MoveFirst
Set rstDataTo = Currentdb.OpenRecordset ("Select * from [tblInput] where [Something] =" & stCriteria
rstDataTo.movefirst

with rstDataFrom
do while not .EOF
stRecords = stRecords & iif(stRecords<>"",vbcrlf,"") & !Field1
.movenext
loop
end with
With rstDataTo
.Edit
!MemoField = stRecords
.update
End with

End Sub
 
Hi Travis,

Thank you very much

I tried what you wrote and it is working
fine

Thanks again

Daniel
 

Users who are viewing this thread

Back
Top Bottom