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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Body of Email Message Problem

Status
Not open for further replies.

naturalsn

Technical User
Apr 26, 2007
68
GB


I am hoping someone can please assist if possible.
I have created a form in Access 2003 that sends an email to Outlook, and all works great no problems.
My problem with the form is, I have a dropdown with the possible responses we can send to our receipients. So upon selecting my type of response, an after update event lists the infomation in my message body.
Code:
Private Sub MessageBodyInfo_AfterUpdate()
Me.mess_text = Me.MessageBodyInfo.Column(2)
End Sub
The MessageBodyInfo comes from a table where the data type is "memo" due to our responses being rather short, or rather large. I have updated my table and the information appears perfectly so no limitation in the table about the amount of data in it, but after my Messagebodyinfo dropdown has updated my field only half of the information appears within my body.

The body is an unbound label and as far as i know there should not be a limitation to the amount of text i put in it. or is there. Is there something i might be overlooking, (having been staring at the screen for ages) any adivse of help would be appreciated.
Thanks in advance
Regards
SN

 
>>>The body is an unbound label

Wouldn't a text box or rich text box be more appropriate?

Can you post your code that sends the email?

Hope this helps,

Alex

Ignorance of certain subjects is a great part of wisdom
 
Hi Thanks for the response, not to sure about text box, will quickly try, the code is as follow

Thanks
Susan

[c]Private Sub SendEmail_Click()

Dim appOutLook As Object
Dim oInsp As Outlook.Inspector
Dim MailOutLook As Outlook.MailItem
Set appOutLook = Outlook.Application
Set MailOutLook = appOutLook.CreateItem(olMailItem)
Set oInsp = MailOutLook.GetInspector
Set WordDoc = oInsp.WordEditor

With MailOutLook

.BodyFormat = olFormatRichText
.To = Me.Email_Address
.CC = IIf(IsNull(Me.CC_Address), "", Me.CC_Address)
.BCC = IIf(IsNull(Me.BCC_Address), "", Me.BCC_Address)
.Subject = Me.Mess_Subject
.Body = vbCrLf & vbCrLf & "Reference No: " & Me.ID & vbCrLf & vbCrLf & Me.mess_text & vbCrLf & vbCrLf & .Body
If Left(Me.Mail_Attachment_Path, 1) <> "<" Then
.Attachments.Add (Me.Mail_Attachment_Path)
End If
.Send
End With
'MsgBox MailOutLook.Body
Exit Sub
email_error:
MsgBox "An error was encountered." & vbCrLf & "The error message is: " & Err.Description
Resume Error_out
Error_out:
End Sub[/c]
 
Terribly sorry not thinking, it is currently a unbound text box. not label
Thanks
 
Have you tried using DLookUp to select the body from the table? I suspect that the dropdown may be causing the problem.
 
Hi Remou
Thank you used Dlookup and work perfectly.. Thanks for he advise.

Regards
Susan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top