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

Auto Emailing from Form

Status
Not open for further replies.

ChrisPanet

IS-IT--Management
Nov 30, 2004
18
GB
Hi all

I have an IT Callout database which logs all calls to the IT Dept, i have a form where the call is logged and what i want to do is upon completion of the form it automatically sends an email to the caller.

I have it 90% done but what i cant do is get the email to send on its own, what i get is an email pop up with all the correct info in but i have to click send, any help on avoiding this??

Here's the code i have at the mo:

Private Sub Callout_Status_AfterUpdate()
Dim strrec, strsub, strbody

'Email Address
strrec = Me.Email

'Email Subject
strsub = "IT Callout Log"

'Break
strbody = Chr(13) & Chr(10)

'Email Body
strbody = strbody & "Your Callout Ref: " & Me.Callout_ID & Chr(13) & Chr(10) & Chr(13) & Chr(10)
strbody = strbody & "Status: " & Me.Callout_Status & Chr(13) & Chr(10) & Chr(13) & Chr(10)
strbody = strbody & "You have requested support with an issue regarding: " & Chr(13) & Chr(10) & Chr(13) & Chr(10)

'Email Record
DoCmd.SendObject , , , strrec, , , strsub, strbody

End Sub
 
DoCmd.SendObject , , , strrec, , , strsub, strbody, False

--
Mike
 
Cheers Mike that works great, however i now get a dialog box pop telling me that another program is trying to send an email on my behalf and i have to click Yes to allow this, is there any way of avoiding this too?

Thanks
Chris
 
Do a google search for outlook object model guard.
Seems that Redemption is a good tool.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Cheers PH ive had a look, looks like a bit of a mine field but ill have a look through all the info.

Thanks again
Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top