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.


 
Nathan, I accidently got it woking partially. The Dim was screwing up so I changed it around to a DLookup and it started to e-mail the notice, but only to me. There was a second checkbox that was checked and that user did not get e-mailed a notice, only me. Here is my code now:
Dim strERecipient As String
strERecipient = DLookup("[EMailAddress]", "tblAuthorizedUsers", "[ApdAsy] = True")
DoCmd.SendObject , , , strERecipient, , , "ECN " & Me!ECNNumber & " is ready for Assembly/Purchasing Approval.", , False
Can anyone tell me why the procedure is only picking up my e-mail address and sending only one me and e-mail notice? There are two users with ApdAsy = true, why aren't both getting picked up and sent notices? Also is there a way to answer yes to the Outlook popup window, which opens in this procedure? Thank you to anyone answering these questions.
 
hi!
you are very familiar with the outlook, so you maybe help with this one:
I need to find the first free time of 1 hour in several people scheduler. how i should do it from access? is there any objects that deals with it?
thanks
eznasi
 
hi guest4,

the dlookup function will only find the first match in your recordset (table) and once the match is made, the email will be sent.

in order to send the email to more than one person, you will have to build a loop to get all the matches.

as far as the popup window, checkout thread: thread705-703295

Have A Great Day!!!, [bigglasses]

Nathan
Software Testing Lead
 
Nathan, I already found that one out the hard way. I built a loop and now it is working great, almost. The only thing I have left is to somehow automatically answer that Yes button in the Outlook popup window. I have to always click it. Do you have any suggestions on that one? Thank you again for the assistance.
 
guest4,

to my knowledge, you cant do much. there seems to be some good suggestions in: Thread705-703295, but i havent tried any of them myself.

hth

Have A Great Day!!!, [bigglasses]

Nathan
Software Testing Lead
 
Thank you for the response, Nathan. I have already been there and read it and another post also. Very interesting with a couple ideas. I also heard about Express Check Yes, though unsafe if run full time, I was curious to see if it could be turned on to run only when an e-mail message/notice was sent and then turned off. They put there source code, in VBA, on the web site. I don't know enough about VB to know if this is even doable or not but maybe someone out there may want to look into that. It seems like this problem is a plain in the but for a lot of users. I know I certainly wish I knew more programing now. Thank you again for the assitance
 
I would really like to try this.. How do I enter and call the subroutine from within Access? I use macros for everything and never really got to grips with VB routines and how to call them...

many thanks!

 
Hi thomasdahl,

You can take the VBA code and place it behind an Event for a control. Such as, draw a command button on a form, goto the properties page, Event tab, OnClick event, select the ... command. This will open your VBA editor and format the event for you. the code from this and other threads will be placed between the preformated event. something like

Private Sub Command3_Click() <---preformatted in Access
'***code goes between starting here
**code
**code
'***ending here****
Exit Sub <---also preformatted

hope this helps. :)

happy thanksgiving!

Have A Great Day!!!, [bigglasses]

Nathan
Software Testing Lead
 
Great Thread multiple stars for multiple people!

Quick Question...

I have a form with one subform.

I was ondering if there was a way to email as an attatchment just the current record of the parent form with all linked child records as well.

I am using outlook, and was using this code to send the entire form but I wanted to only send one record not all records.

Private Sub Command64_Click()
On Error GoTo Err_Command64_Click

Dim stDocName As String

stDocName = &quot;frmSIR&quot;
DoCmd.SendObject acForm, stDocName

Exit_Command64_Click:
Exit Sub

Err_Command64_Click:
MsgBox Err.Description
Resume Exit_Command64_Click

End Sub


Thanks in advance,

Neo
 
Can someone please tell me why the below code is not sending the email automatically?

Dim strSubject As String

strSubject = Me.title

DoCmd.SendObject acSendReport, &quot;rpt_PAF_GenUserEmail&quot;, acFormatSNP, &quot;&quot;, &quot;email@anywhere.com&quot;,, strSubject, &quot;Subject Line Text Here.&quot;, False

I want the email to be sent without being edited and this is not working.

Also, how would one suppress the virus message that pops up when it is being sent without being edited?

Help Please,

Thanks,

Jerome Benton
JERPAT Web Designs
GOD Is Good All The Time!!!
 
No, I haven't figured that one out, because there is no way. I looked all over for that answer and the only thing I found was something about Outlook Redemption. I looked further on this so called free tool, and this is what I found:

The reason I thought it cost, is because of the statement that is on the download page, which I have pasted below:

By downloading and installing this software you agree to the following terms and conditions:

The version of Redemption available from the link below is licensed for the development purposes only. It cannot be used with any commercial software.

If you plan to include Redemption with a commercial product, you must purchase a distributable version which you can then use for any and all of your products. The cost of the distributable version is $199.99, there are no royalties of any kind. You only need to buy a single license, no matter how many of your products use Redemption or how many copies of your application you distribute. Note that the definition of commercial software also includes internal applications whether they are available to the public or not.

As a bonus, distributable version of Redemption includes ProfMan library which can be used to manipulate MAPI profiles. Distributable version of Redemption also comes with a customization tool that lets you create a version of Redemption with custom class names and class GUIDs.

I have commercial software at my job (microsoft office), so I think we would have to buy it. I know they wouldn't be willing to buy this product:)

So I don't of anything else that would solve this problem, and I WISH I did.

Have a good one,

Jerome Benton
JERPAT Web Designs
GOD Is Good All The Time!!!
 
Daniel, interesting suggestion. I have my e-mail selecting and sending e-mail messages correctly now, but I keep getting that dang popup window. I have not heard of CDO, what is it and how does it work? Thank you for the info.
 
Thank you, Daniel. I will definately check into this one, it sound promissing. This post is starting to look like it is taking on a life of its' own. Thanks.
 
Daniel, one last question, where can I get a copy of CDOEX.DLL? MS support has nothing, that I can find at least. Thanks again.
 
Search your system for CDOEX.DLL or CDOSYS.DLL
Or CDOWhatever.DLL
If you have it, the code should work fine from the beginning. If it doesn't, do a regsvr32 in Start-Run

AFAIK, the CDO is included in the operating system starting with Windows 2000, but I believe (not sure) that MSOffice suite has it somewhere.

You're right about this thread, but it looks like nobody feels bad about it [smile]

HTH


[pipe]
Daniel Vlas
Systems Consultant

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top