Can someone perlease tell me what's wrong with this code

If DocA.HasItem(“Comments1”) Then Dim strComments1 As String

strComments1 = DocA.Comments1(0)

If Trim$(strComments1) <> "" Then

	Dim strComments As String

	strComments = DocB.Comments(0)

	If Trim$(strComments) <> "" Then strComments = strComments + Chr$(13) + Chr$(13)

	Call DocB.replaceItemvalue("Comments", strComments + Date$ + | Subs Comments : "| + strComments1 + |"|)

End If

End If

Any idea why

10/11/2006 Subs Comments :

should appear on DocB with no other text copied across? 'Cos it is.

Can anyone see a problem with that logic, because I can’t?

Why copy just the “10/11/2006 Subs Comments :” if the other strings are empty.

Many thanks if you can help.

Subject: Can someone perlease tell me what’s wrong with this code

Check Len(strComments) and Len(strComments1) to see what they return. Store the new value in a string and see what it evaluates to. It could be that your field is configured incorrectly to display the value you want to show. Are either of the comment fields RichText? Those have to be handled differently.

And finally, a new line sequence is actually two characters: Chr$(13) & Chr$(10). That’s a carriage return and a new line.

Subject: Can someone perlease tell me what’s wrong with this code

Steven,

There are things I wouldn’t do, which you’ve done, but I don’t know that they’re wrong or causing your problem. In terms of troubleshooting, I would try just using docB.replaceitemvalue ( “Comments”, strComments & " – " & " Sub Comments : " & strComments1 ) to see if the hard carriage returns or the plus signs (+) are an issue.

regards,

raphael