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

Code error When Emailing From Access Form

Status
Not open for further replies.

JillianM

Technical User
Jun 10, 2010
23
US
Hi guys, I am completely in the dark but managed to piece together some coding that allows me to email directly from an Access Form. When I click my "Send email" command button, my Outlook opens and the Subject and To lines are filled in correctly, but I can't figure out how to get the body to fill in as well. This is what I have:

Private Sub Command66_Click()
Dim stLinkCriteria As String
Dim Subject As String
Dim Text As String
Dim Message As String

If IsNull([RepEmail1]) Or ([RepEmail1]) = "" Then
MsgBox "There is no E-mail address entered for this person!"
Exit Sub
Else
stLinkCriteria = Me![RepEmail1]
stSubject = "Mobile Lab Cadaver Disposal Fee"
stText = "Test"
DoCmd.SendObject acSendNoObject, , , stLinkCriteria, , , stSubject
End If
End Sub

I have looked at a bunch of other code and replaced Text with everything from Body to MessageText with no success. I want my email to read
Text = "A " & [CadaverType] & "was used during the mobile lab on "& [LabDate] & ". The disposal fee for this is $40.00. Please let me know if you want to accept the full amount of this charge. If this charge should be broken up between reps, please let me know who should be charged and how much. Thank you"

Any help would be greatly appreciated. I am going crazy trying to get this to work. Thanks!
 
DoCmd.SendObject acSendNoObject, , , stLinkCriteria, , , stSubject, stText

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
If I could kiss you through the computer screen, I would. Thank you so much!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top