Insert line feed/carriage return in message

G

Guest

Hi

I've a piece of code which sends an email including a message into which I
want to add a number of fields. However, I can't work out exactly how to put
a carriage return or line feed into the message as I don't want it to be one
continuous paragraph. I've seem something in the groups about the Chr$(10)
and Chr$(13) but couldn't get these to work.

My code currently looks like this:

With CodeContextObject
DoCmd.OpenReport "Full_Call_Report", acPreview, "",
"[Calls]![Call_Ref]=[Forms]![Calls]![Call Ref]"
DoCmd.SendObject acReport, "Full_Call_Report", "RichTextFormat(*.rtf)", "",
"", "", "(TE" & .[Call Ref]& ") - Re: " & .[Problem Summary], "Please see
attached call details", True, ""




I'd like to insert some more text and a couple of fields after "Please see
attached call details" but I need to seperate the paragraphs....

Thanks

Martyn
Windows XP, Access 2000
 
G

Guest

Try using ..., "Please see attached call details" & vbCrLf & vbCrLf & "Some
more text.",...

Hope this helps.
 
R

Rick Brandt

WembleyBear said:
Hi

I've a piece of code which sends an email including a message into which I
want to add a number of fields. However, I can't work out exactly how to put
a carriage return or line feed into the message as I don't want it to be one
continuous paragraph. I've seem something in the groups about the Chr$(10)
and Chr$(13) but couldn't get these to work.
[snip]

"Some text for paragraph1" & Chr(13) & Chr(10) & _
"Some text for paragraph2"

You need both 13 and 10 and in that order.
 
G

Guest

That's cool - looks like it will work a treat - thanks guys. Another prob
now, as I'm new to VB in Access, how do I add this code to a command button
on a form? (I tried to add it to the OnClick event but it threw a fit on me &
now won't let me edit that form at all. Good job I had a backup...)

Could you explain in newbie language for me?

Thanks
Martyn

Rick Brandt said:
WembleyBear said:
Hi

I've a piece of code which sends an email including a message into which I
want to add a number of fields. However, I can't work out exactly how to put
a carriage return or line feed into the message as I don't want it to be one
continuous paragraph. I've seem something in the groups about the Chr$(10)
and Chr$(13) but couldn't get these to work.
[snip]

"Some text for paragraph1" & Chr(13) & Chr(10) & _
"Some text for paragraph2"

You need both 13 and 10 and in that order.
 
G

Guest

Form in design view
Select button
(If you want to have a new button - disable control wizards on Toolbox)
View Properties (F4)
Events tab
Click at On CLick row; button with three dots appears to the right ("create
button")
Choose code builder; the correct event handler is created for you
By now you're in the event procedure - start writing code!
Br,
kkarre

WembleyBear said:
That's cool - looks like it will work a treat - thanks guys. Another prob
now, as I'm new to VB in Access, how do I add this code to a command button
on a form? (I tried to add it to the OnClick event but it threw a fit on me &
now won't let me edit that form at all. Good job I had a backup...)

Could you explain in newbie language for me?

Thanks
Martyn

Rick Brandt said:
WembleyBear said:
Hi

I've a piece of code which sends an email including a message into which I
want to add a number of fields. However, I can't work out exactly how to put
a carriage return or line feed into the message as I don't want it to be one
continuous paragraph. I've seem something in the groups about the Chr$(10)
and Chr$(13) but couldn't get these to work.
[snip]

"Some text for paragraph1" & Chr(13) & Chr(10) & _
"Some text for paragraph2"

You need both 13 and 10 and in that order.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top