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.
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.
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.
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.
mods - double post
https://www.accessforums.net/showthread.php?t=85158
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.
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.
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
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.
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.a total calculates all of them together. This is also called "Totoal_Hours".
You want what?I want, when the value for any of the entry, in this case "Serial Number" has a "total_hours" of anything over 15 hours.
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.
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.
I’ll bow out as well since there are more responses on the other thread
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.
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.
Hmm, thinking you could modify the below to meet your needs...
https://www.access-diva.com/vba18.html