Sending Email from Form

G

Guest

Hello,

I was wondering if there is a way to format the information sent in a email
from an Access Form.

Example:

Here is the code I am using which I obtained from this Forum:

Dim SendTo As String, MySubject As String, MyMessage As String
SendTo = "(e-mail address removed)"
MySubject = "Issue"
MyMessage = Me.LoanNumber & " " & Me.ErrorCode & " " & Me.Comments
DoCmd.SendObject acSendNoObject, , , SendTo, , , MySubject, MyMessage, True

The works great and will do the job. However, is there a way to format on
the email like this:

Loan Number:
Error Code:
Comments:

Right now it doesn't show the field names and enters it in a sentence.
Again, this will work but I was trying to make it look more organized for the
users.

Thanks!!!!
 
G

Guest

Use the following instead of vbCR or vbCRLF in order to insert Carriage
returns:
%0D%0A
So,
MyMessage = Me.LoanNumber & "%0D%0A" & Me.ErrorCode & _
"%0D%0A" & Me.Comments

LOL

jmonty
 
G

Guest

Hi jmonty,

It doesn't work. When I insert it into the code, it show in the memo but not
on the next line.

Thank you away for your response!!
 
G

Guest

Looks like I am using a different method to send email.

Maybe try using the vbCr or Chr(13) instead:

MyMessage = Me.LoanNumber & vbCr & Me.ErrorCode & _
vbCr & Me.Comments
or
MyMessage = Me.LoanNumber & vbCrLF & Me.ErrorCode & _
vbCrLF & Me.Comments
or
MyMessage = Me.LoanNumber & Chr(13) & Me.ErrorCode & _
Chr(13) & Me.Comments



jmonty
 
G

Guest

The first one works!! I didn't try the other two. Thank you very much for
following up and giving a helping hand! The message looks much cleaner now.

Thanks again, you're help was most appreciated!
 
G

Guest

I am very glad I could help!

jmonty


Doug_C said:
The first one works!! I didn't try the other two. Thank you very much for
following up and giving a helping hand! The message looks much cleaner now.

Thanks again, you're help was most appreciated!
 

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

Similar Threads


Top