Append a new comment to an existing comments in a memo field using VBA (Access 2007)

Hello, I would like to programmatically (VBA) append a new comment to a memo field that already has comments in it. The desired result should be to create a new line for the new comment.

This is how this will look like in the memo field:
This is the first comment.
This is the second Comment.
This is the third comment.

And NOT: This is the first comment. This is the second Comment. This si the third comment.
I need to use the hard return for each new comment

I am currently using:  
Me.Notes = Me.Notes & vbCrLf & "Kit mailed e-mail sent by " & Forms![Welcome]![UserName] & " on " & Date & "."

However, this does not give me hard return between the existing memo and the new appended note. I have also tried Chr(13) & Chr(10) instead of vbCrLf and I am getting the same result.





Cobra967Asked:
Who is Participating?
 
HainKurtConnect With a Mentor Sr. System AnalystCommented:
as I said before use

Me.Note = Me.Note & "<br>" & "This is note 1." 'Preserve the existing text, and a new line and add the next note
0
 
HainKurtSr. System AnalystCommented:
try:

Chr(10)
Chr(10) & Chr(13)
Chr(13)
"<br>" and enable format to rich text... I am not sure if this works in your case...

can you please post a sample db?
0
 
Cobra967Author Commented:
See the attached example. Just open the form and click on the buttons to see the bad result.
NewNote.accdb
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
HainKurtConnect With a Mentor Sr. System AnalystCommented:
you can also use "<p>...</p>" or "<div>...</div>"
NewNote.accdb
0
 
Cobra967Author Commented:
Hain, almost perfect. I am saying almost because if the memo alredy has a text in it. Then for some reason I amgetting blank line between the old note and the new one:

example:

This is the existing comment.
(this is where the blank line is)
New Comment 1
New Comment 2
New Comment 3

The way should be is:
This is the existing comment.
New Comment 1
New Comment 2
New Comment 3


0
 
Cobra967Author Commented:
Just to be clear: I did not press enter (create a new blank line) when I typed in the old comment manually.
0
 
Cobra967Author Commented:
Bingo! If I use <p>  or <div> will not create the blank space. Thank you for your help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.