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

Send e-mail from access databases 65

Status
Not open for further replies.

tpowers

Technical User
Nov 2, 2002
153
0
0
US
Now I am a new guy on the block, so bear with me. I have a form that users are entering client information into all day, and I have been asked to set the database up so that when the are done entering the record that it will automaticlly send the client a confirmation e-mail that the record as been recieved and entered into our database.

Again I am new at this so if so one as a clue of how to do this that would be great.


 
Hi I just have a quick question. I am getting an error that says "Error loading DLL". Does anyone know what this means
 
Hey everyone, this is an outstanding thread i must say. I have a quick question to add to it and maybe i can get some help.
I have a table in access called CambeOrders
the table has a few identifying fields for name, company, ect. I also have two other fields on the table that are critical to the process i am making. The first in a Yes/No field called Priority, and the second is a date field called OrderDate.
What i want to do is create an email system to send out orders from my company.
Everyday, say at 3:00 PM i want to have the table checked to see if there are any priority orders on that day, if there is, then i want the table converted to an excell format, which has already been covered in this thread, and have the priority orders sent in an email attachment.
Every 14 Days i want the table to be checked for all non prioity orders for the past 2 weeks. I then want these orders to be sent as an excel attachment.
Here's the hitch. I want to be able to do this without having to leave the database open and running all of the time. Is there a way to do it with scheduled tasks or some program always running in the background? I am pretty sure i can handle all of the code for creating and mailing the attachments. I just need something to handle when the attachment needs to be mailed. Any help would be appriciated.

Durible Outer Casing to Prevent Fall-Apart
 
Just a quick thank you to everyone who has provided all of this valuable information. I am just wondering if there is anyone who knows about setting this up who can answer my question. I have two computers and i just formated one of the and I am having trouble setting this back up so I can send the emails from access through outlook. I checked and I have all of the same references and I installed every feature that is included in access, outlook, word, and the shared utilites that came with my office program (xp). However I keep getting an error that says "Error loading DLL". Does anyone know what this means?
 
With regards to the previous post and the error with DLL, I forgot to mention that the code that was causing the error was:
Set objOutlook = CreateObject("Outlook.application")
Thanks again
 
Ok I think that I have the problem narrowed down. Word can't open a email message. It says that there was either a problem with the installation or a network problem. The computer connects to the internet fine,(even though I don't think that it has to connect to the internet to open a email message) so I am guessing that it is an installation problem. I have tried uninstalling and reinstalling this several time and still no luck. Does anyone have any suggestions? Thanks.
 
Good Morning.

Does anyone know how to center text in strBody? I think it's text align
strBODY = strBODY & TextAlign("Assistant to Director", 2) & Chr(13), but I get a Compile Error
Sub Or Function not defined.

Any help will be appreciated.

Sharon Niles

 
myBodyText = "<Center><B>This is how to Center and Bold Text" & "</B></Center><br><br>"

You also need:

YourMail.HTMLBody = myBodyText

to enable processing of html

 
Thank you, dRahme. I'm sending a mass e-mail merge via Access using sendmsg.

With your example,
strBody = "<Center><B>This is how to Center and Bold Text" & "</B></Center><br><br>"

In this case, what is YourMail to enable HTML processing? Your help is much appreciated.

Sincerely,
Sharon Niles




 
to enable HTML processing, use the HTMLBody property of the MailItem object instead of the Body property.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Is it possible to change the name of the file that appears when using sendobject.

For example when sending a query (qryTest) as an Excel document, I would like to name the query something more meaningful ("Test 11-04") without having to change the name of the query in Access.

Thanks

Never try to teach a pig to think. It doesn't work and it annoys the pig.
-Anonymous
 
Hi, Try doing it beforehand with DoCmd.OuputTo :

DoCmd.OutputTo acOutputQuery, "qryTest", acFormatXLS, "C:\Test\Test 11-04.xls"

 
Hi, I have a form with a list of people with email and other fields.

I want to send them each an email. How do I use the the send email function you were talking about earlier and actually loop through each record?

(I don't want to have to go through and push each button individually on a subform)
 
Browse the form's RecordsetClone object.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
To loop through you need to do something like this...

Public Sub rtTradeConfirmGeneral()

Dim strCustomerName As String
Dim intRecordCnt As Integer
Dim d As Integer
Dim stDocName As String
Dim strMessageBody As String


'generate a list of clients that need confimrming.

Set rstChkConfirm = New ADODB.Recordset
rstChkConfirm.CursorLocation = adUseClient
rstChkConfirm.Open "SELECT Count(tblBrokers.BrokerName) AS CountOfBrokerName, tblTrades.TradeConfirm, tblBrokers.BrokerName, tblCustomers.customerName, tblBrokers.EmailContact FROM tblCustomers INNER JOIN (tblBrokers INNER JOIN tblTrades ON tblBrokers.brokerID = tblTrades.BROKERID) ON tblCustomers.Customer = tblBrokers.CUSTOMERID GROUP BY tblTrades.TradeConfirm, tblBrokers.BrokerName, tblCustomers.customerName, tblBrokers.EmailContact HAVING (((tblTrades.TradeConfirm)=No) AND ((tblBrokers.EmailContact) Is Not Null));", CurrentProject.Connection, adOpenKeyset, adLockOptimistic

'Set the amount of loops to run
intRecordCnt = rstChkConfirm.RecordCount


For d = 1 To intRecordCnt

'Set strCustomerName as a customer name
strCustomerName = rstChkConfirm("BrokerName")

'Set the email for filtering the report
strEmail = rstChkConfirm("EmailContact")

DoCmd.SendObject acSendReport, "rptConfirm", acFormatHTML, strEmail, , , "Trade Confirms from Kyte Options " & date, , no, False


rstChkConfirm.MoveNext

Next d
'Turn off the system warning
DoCmd.SetWarnings False

'set the confirmed button
DoCmd.RunSQL "UPDATE tblBrokers INNER JOIN tblTrades ON tblBrokers.brokerID = tblTrades.BROKERID SET tblTrades.TradeConfirm = Yes WHERE tblTrades.TradeConfirm = No AND tblBrokers.EmailContact Is Not Null OR tblBrokers.EmailContact= ' & strEmail & ' ;"

'Turn on the system warning
DoCmd.SetWarnings True

rstChkConfirm.Close
End Sub
 
I have a problem, my customers cannot open the attachment formatHTML Does anyone know how I can copy the Report into the message body as text? What would you do?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top