473,507 Members | 2,389 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sending a Email from Access if condition is met

17 New Member
I have worked with Access for awhile but never had to send any emails out as a result of a field.

The situation I have is as follows, if a dollar amount [amount] is over $1000.00 an email generates to a specific email address. The address is static, I would like to include the name of the client[clientname] and the dollar amount in the email.

I read through a couple of threads and added the Outlook.Application library but not sure how to accomplish the rest.

Thanks for your help.
Jul 8 '08 #1
1 1354
ckrows
17 New Member
OK Follow up to the original question.
I have put together some code that is almost working.
a couple of problems, i get a invalid use of null on this code when i add the stDollaramt to the subject line. Why?
Also this code is opening the email window, how would i get the email to automatically go and not have the user see the email form?
Thanks I really appreciate your help.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command54_Click()
  2. On Error GoTo Err_Command54_Click
  3.  
  4.     Dim stDocName As String
  5.     Dim stName As String
  6.     Dim stClientID As String
  7.     Dim stDollarAmt As String
  8.  
  9.     stName = Me.CTSNAME.Value
  10.     stClientID = Me.CTSID.Value
  11.     stDocName = "Empty_Report"
  12.     stDollarAmt = Me.ExposureAmt.Value
  13.  
  14.     DoCmd.SendObject acSendNoObject, stDocName, acFormatTXT, "Service@yahoo.com", , , stName & " Exposure Warning", "Client " & stClientID & " has a proposed exposure of " & stDollarAmt & "in Penalty", , True
  15.  
  16. Exit_Command54_Click:
  17.     Exit Sub
  18.  
  19. Err_Command54_Click:
  20.     MsgBox Err.Description
  21.     Resume Exit_Command54_Click
  22.  
  23. End Sub
  24.  
Jul 8 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
4128
by: Devonish | last post by:
I am composing an email with Access VB and then sending it from within Access. Everything works correctly (the email actually goes!) but Outlook ask some irritating questions that the user is...
8
2339
by: WindAndWaves | last post by:
Hi Gurus I am trying to send a newsletter from Access. Can anyone tell me what is the simplest way to send an email from Access? I would prefer not to use outlook, because this gives me all...
2
2205
by: kimberly.shaffer | last post by:
Okay, I can automate sending of multiple emails with records using Groupwise and Access DB. But now what I need to do is send multiple fields associated with one field out automatically and can't...
7
3543
by: Marcin | last post by:
Hello all! A few years ago I created a form with button which let me send an email with an attachment. It was created in Access 97. Now I would like to move this application into Access 2003....
17
2874
by: Bonj | last post by:
Right guys. (I would like a solution to this in VB6 as this is what our needy app is written in, but any solutions that involve .NET would be much appreciated likewise as I could instantiate...
3
6806
by: VB Programmer | last post by:
I have an ASPX page where I send out emails through my mail server mail.MyDomain.com. When I send emails to MyName@MyDomain.com it sends PERFECTLY. When I try sending an email to any other address...
3
1519
by: Nicola | last post by:
When using the NewMail.Body object, ! and spaces are being added into the email after the email has been sent. Has anyone else had this problem or even better a solution??
1
8154
by: Eric Sheu | last post by:
Greetings, I have been searching the web like mad for a solution to my SMTP problem. I am using Windows Server 2003 and ASP.NET 2.0 w/ C# to send out e-mails from a web site I have created to...
7
4375
by: Ray Booysen | last post by:
Hi all I'm sending email via ASP.NET in HTML mode. Each email has exactly one attachment and I do have full access to the SMTP server. However, if I send the email in HTML format, the...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7321
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7377
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7034
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7488
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1544
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.