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

Edit body of Access send email

Status
Not open for further replies.

KiaruB

Technical User
Apr 5, 2005
35
DE
Hi all,

I have constructed some code that takes data out of a query based on an open form

the data is put into the body of an email and is send

now this is what i wont get to work :

the person who receives the email needs to add or change the
data in the email body so he can send the email back with the
right data

i cant seem to find any solution to make this work, the
data in the email body is read only

this is my code, anyone any ideas on this one :



Private Sub Command33_Click()
On Error GoTo Err_Command33_Click

DoCmd.Echo False 'switch echo off so query is not displayed
DoCmd.OpenQuery "Query : Aanvraag CC", acNormal, acEdit 'open the query to get the email value
DoCmd.Close acQuery, "Query : Aanvraag CC", acSaveNo 'close query
DoCmd.Echo True 'switch echo back on

stKlantId = DLookup("[Klant ID]", "Query : Aanvraag CC")
stNaam = DLookup("[Naam]", "Query : Aanvraag CC")
stAdres = DLookup("[Adres]", "Query : Aanvraag CC")
stWoonplaats = DLookup("[Woonplaats]", "Query : Aanvraag CC")
stPostcode = DLookup("[Postcode]", "Query : Aanvraag CC")
stStartdatum = DLookup("[Startdatum]", "Query : Aanvraag CC")
stExpr1 = DLookup("[Expr1]", "Query : Aanvraag CC")
stCreditC = DLookup("[Credit check]", "Query : Aanvraag CC")
stOpmerk = DLookup("[Opmerkingen]", "Query : Aanvraag CC")
stNassC = DLookup("[Nassubel Code]", "Query : Aanvraag CC")
stBTWnr = DLookup("[BTW nr]", "Query : Aanvraag CC")

Dim myApp As New Outlook.Application
Dim myItem As Outlook.MailItem
Set myItem = myApp.CreateItem(olMailItem)
With myItem.BodyFormat
.Importance = 2
.To = "email address"
.Subject = "Automated Credit Check"
.ReadReceiptRequested = False
.Body = "Credit Check aub :" & vbCr & _
"Klant ID : " & stKlantId & vbCr & _
"Naam : " & stNaam & vbCr & _
"BTW nr : " & stBTWnr & vbCr & _
"Adres : " & stAdres & vbCr & _
"Woonplaats : " & stWoonplaats & vbCr & _
"Postcode : " & stPostcode & vbCr & _
"Startdatum : " & stStartdatum & vbCr & _
"Maandbedrag : " & stExpr1 & vbCr &
"Credit Result : " & stCreditC & vbCr & _
"Nassubel Code : " & stNassC & vbCr & _
"Opmerkingen : " & stOpmerk

End With
myItem.Send

Exit_Command33_Click:

Exit Sub

Err_Command33_Click:
MsgBox Err.Description
Resume Exit_Command33_Click


Many thanks ! :)
 
Send an attachment.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Sending an attachment is the easy way but not the solution im looking for.

I need the body to be editable.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top