inserting a carriage return in string

  • Thread starter Thread starter Eric`
  • Start date Start date
E

Eric`

I'm trying to load a memo field with a carriage return
using an SQL statement. The following code using an ASCII
character does not work. What does?

str = "UPDATE [Action] SET [Action].ActComment = [Action]!
[ActRequest] & Chr(13) & " & _
"[Action]![ActCustomerName];"
db.Execute str
 
Chr(13) is Carriage Return. You need both Carriage Return AND Line Feed,
which is Chr(10).

The following may work better:

str = "UPDATE [Action] " & _
"SET [Action].ActComment = [Action]![ActRequest] " & _
vbCrLf & "[Action]![ActCustomerName]"
 
Back
Top