Emailing from Access 2003

  • Thread starter Thread starter wwwscottcouk
  • Start date Start date
W

wwwscottcouk

Guest
Hi....

New to the forum - so hopefully I'am starting with a simple one :-)

I have a helpdesk database which has been working for a number of years, I'am now looking to automate my responses via email. Is it possible for Access to grab info off a particular record, create an email to the person who logged the fault and then send it to them on a completion email with all the details on it ?

We are using Outlook 2003.

Thankyou for any help, it is much appreciated.

Scott
 
Try it

Code:
Dim objNewMail
Dim strTo As String
Dim strDisplayName As String
Dim strSubject As String
Dim strBody As String


Dim strToField As String

Dim strMessage As String

' use the Me.[FieldName] to get the value from any field.

strToField = "your@email.com"
strSubject = "subject please"
strMessage = "abcd, ...."

DoCmd.SendObject , , , strToField, , , strSubject, strMessage, False
 
Am also new to this

Where precisely can I use "Me.[FieldName]" to get it to use the field name within the subject line of the email?

Can I also use this format to send to more than 1 email address?

Thanks

Paul
 
Where precisely can I use "Me.[FieldName]" to get it to use the field name within the subject line of the email?

Me.???? where the ??? is the name of your control on the form is going to give you whatever value is in that control at the time. So if you have a text box named mysubject then Me.mysubject will give you whatever is in that text box.

Can I also use this format to send to more than 1 email address?
Yes you can. I am a learner too and really the best way to learn all about these things called Objects, methods, functions and properties is to try to always understand it from the beginning. Then one day it will click.

I find the F1 in Access is ok but I have MSDN as a link in FireFox and I always seem to get more information from it.

So have a look here and it will tell you how to send it to multiple people

http://msdn.microsoft.com/en-gb/library/aa220736(office.11).aspx
 
Thanks Darbid,

Yes, I understood the purpose of the Me[field] thing but just didnt know where to put it in the code.

All sorted now. Thanks for the advice :)

strToField = "email@domain.com"
strSubject = "New PO for " & Me.[Customername] & " PO# " & Me.[PONumber] & " Target Ship Date: " & Me.[PO_TargetShipDate]

Cheers

Paul
 

Users who are viewing this thread

Back
Top Bottom