Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding new line to memo field with SQL statements 2

Status
Not open for further replies.

Cleggy

MIS
Nov 14, 2001
9
0
0
GB
I have a query that appends data from 2 text boxes into a single memo field, when I'm using VBA I'd send out a vbcrlf between the two fields to add a new line, but I need to do this in a query and vbcrlf didn't work.

The section of the query is as follows:

"E-Mail subject: " & [forms]![frm_email]![subject] & " Message: " & [forms]![frm_email]![message]

What can I put between [subject] and & " Message..." to split the 2 with a new line?

Any suggestions gratefullt recieved...

Cheers.
 
Try Chr(10) & Chr(13)

It's the old equivalent of vbCrLf and can be used in queries.

Dan
[pipe]
 
Thanks Dan, but this adds two empty squares rather than adding a new line, is there something wrong with how I've included it in the query?

"E-Mail subject: " & [forms]![frm_email]![subject] & Chr(10) & Chr(13) & " Message: " & [forms]![frm_email]![message]




 
Reverse the characters. It needs to be chr(13) then chr(10) Maq [americanflag]
<insert witty signature here>
 
I should have checked first...you're right.
But I figured out something:
When you build your string, watch this:

&quot;E-Mail subject: &quot; & [forms]![frm_email]![subject] & &quot;Press Ctrl+Enter here&quot; & &quot;Message: &quot; & [forms]![frm_email]![message]

What I mean is that you will enter a non printing character seen as &quot;&quot; but evaluated as a new line...

OK now?

Regards,

Dan
[pipe]
 
Thanks! Both these suggestions worked. Problem solved.

Cheers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top