Results 1 to 12 of 12
  1. #1
    cbuechner is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Jan 2021
    Posts
    60

    AUto Generated EMail


    First, this site is the best! I am still learning.

    I want to autogenerate an email when a value in a access query has been reached. I am researching it, but the only thing I can find is excel. Maybe it cant be done.

  2. #2
    cbuechner is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Jan 2021
    Posts
    60

    AUto Generated EMail

    Ok love this site.

    I would like like the ability to send out an email (automatically) when a query result reaches a value. Not sure if this is possible. The only research I can find is from excel.

  3. #3
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,790
    Certainly, but you will have to do it with code. Queries cannot send emails. There are lots of code samples posted that show how to send emails, some deal with sending reports and such, but the code for automating Outlook is pretty much the same. All your code would need is to get the trigger value from somewhere. If it's in a table already, you don't even need a query. If the query calculates the value, then probably do need it. So a lot more info about what you have will be required to get more focused responses.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,790
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    cbuechner is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Jan 2021
    Posts
    60
    Ok the user enters data into the "MAIN_DATA". In it, they enter values for hours in multiple occurrences. On a separate query, called "TOTAL_HOURS", the occurce hours are displayed, and then a total calculates all of them together. This is also called "Totoal_Hours". I want, when the value for any of the entry, in this case "Serial Number" has a "total_hours" of anything over 15 hours.

  6. #6
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    I'll responded on this sub forum since the question would appear to be more focussed on programming rather than overall 'access'

    @cbuechner - sending emails from access is not a problem. The problem is when to send it and by what method. So you need to:

    1. explain what 'when a value in a access query has been reached' means. Provide some example data and the process that happens to change that value to a point when an email needs to be generated.
    2. clarify what needs to go in that email and where that data can be found (including the email address)
    3. by what method you want to send it - using CDO or outlook automation
    4. If you have found examples in excel, provide some links, it will help us to understand what you are looking for and perhaps what you are not looking for

  7. #7
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,790
    MAIN_DATA is what, a query? Users should not be entering data in queries (use forms instead) but that's not going to prevent you from sending email.

    a total calculates all of them together. This is also called "Totoal_Hours".
    Then this query has to be run from code from a form. If you don't have a form to do this, you need to create one.


    I want, when the value for any of the entry, in this case "Serial Number" has a "total_hours" of anything over 15 hours.
    You want what?
    Are you storing the calculations in a table or just performing the calculations in TOTAL_HOURS query?
    You want the query to return any serial number where the hours field in the query >= 15 for those serial numbers? Does your TOTAL_HOURS query do that now?
    And what goes into the email??
    Last edited by Micron; 01-14-2022 at 11:19 AM. Reason: clarification
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  8. #8
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,790
    I'll bow out since I seem to be continuing to reply in the wrong forum.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  9. #9
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    I’ll bow out as well since there are more responses on the other thread

  10. #10
    cbuechner is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Jan 2021
    Posts
    60
    Main_Data is a table, they enter the values on forms. The user would not need to open the query. I can run from a form. or multiple forms?

    Yes values in the table "main_data" are just the values, and then in a quary, I pull in those values. On the query, I add all of them up for a total hour. I would think something like "Serial Number MAX reached" subject line, and then the body to contain brief text of the same with the actual serial number, for any that the total reaches 15.

  11. #11
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Duplicate threads merged since both had replies. In the future, rather than post a second time if you feel you posted in the wrong forum, you can report your own post and ask moderators to move it to the other forum.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  12. #12
    GinaWhipp's Avatar
    GinaWhipp is offline Competent Performer
    Windows 7 64bit Access 2013 32bit
    Join Date
    Jul 2011
    Location
    Ohio, USA
    Posts
    377
    Hmm, thinking you could modify the below to meet your needs...
    https://www.access-diva.com/vba18.html

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 10
    Last Post: 03-01-2019, 08:51 AM
  2. Build a system generated email
    By Woodmansterne_Ralph in forum Access
    Replies: 3
    Last Post: 01-11-2017, 03:22 AM
  3. embed hyperlink in vba generated email
    By jlawson258 in forum Forms
    Replies: 1
    Last Post: 11-21-2016, 08:11 AM
  4. Replies: 2
    Last Post: 09-18-2012, 11:52 AM
  5. Auto-Generated Email
    By jle0003 in forum Access
    Replies: 3
    Last Post: 08-20-2012, 01:33 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums