Insert new line in record (memo)

systemx

Registered User.
Local time
Today, 21:41
Joined
Mar 28, 2006
Messages
107
Hi all,

Hopefully a very quick and easy one.

I have a memo field that is updated from time to time and acts a running sheet for customer enquiries. I am using the following code to update using SQL -
Dim strSQL As String

strSQL = "UPDATE tblEnquiries SET Running_Sheet =" & Chr(34) & Me.txtPriorContact.Value & ";" & Me.txtRunSheet.Value & Chr(34)
strSQL = strSQL & " WHERE ID = " & Me.txtID.Value & ";"
CurrentDb.Execute strSQL

I was under the impression that the semicolon ";" forced a new line in the record - but this does not seem to work. Can anyone help me with this one?

Thanks

Robert

EDIT: I have now found the correct answer Chr(13) & Chr(10) in the statement. Thank you :)
 
Last edited:
alternative solution instead of hard coding

i dont know if u r still workin on this or not, but this may benefit others as well. so i'll go ahead and post it. if u go into the properties of the memo field under the other tab. u will see an option for "enter key behavior". just change that to "new line in field". i dont really understand what the sql is quite doing, but this is helpful for NON-SQL users of Access.

please note that this option is from a MSAccess2K version, so it may or not be different in other versions.

good luck!:)
 

Users who are viewing this thread

Back
Top Bottom