Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 08-30-2019, 01:50 AM   #1
Ravi Kumar
Newly Registered User
 
Join Date: Aug 2019
Posts: 86
Thanks: 106
Thanked 0 Times in 0 Posts
Ravi Kumar is on a distinguished road
E-mail criteria

Dear all,
I have two columns in my dept heads table ,1 is the location & other is their email id .
Now in my report I have three columns,1 is location & 2nd is task name , & the other is task due date .
now i have written a small program to send a mail if any one of the location is set (filtered), using if else.
but i need a code where it sends a mail to everyone related to the location column say out of 10 location ,i have filtered 4 of them.
then it should send a mail to all the 4 dept heads related .
can any one send me the code pls.

Ravi Kumar is offline   Reply With Quote
Old 08-30-2019, 06:44 AM   #2
sxschech
Newly Registered User
 
Join Date: Mar 2010
Posts: 613
Thanks: 28
Thanked 112 Times in 101 Posts
sxschech is on a distinguished road
Re: E-mail criteria

Using your example, is the expectation to have one email with 4 recipients in the 'to' or one email for each recipient (4 separate emails)?
sxschech is offline   Reply With Quote
The Following User Says Thank You to sxschech For This Useful Post:
Ravi Kumar (08-30-2019)
Old 08-30-2019, 07:25 PM   #3
Ravi Kumar
Newly Registered User
 
Join Date: Aug 2019
Posts: 86
Thanks: 106
Thanked 0 Times in 0 Posts
Ravi Kumar is on a distinguished road
Re: E-mail criteria

sir ,
I have send one email with 4 recipients in the "TO"....

Ravi Kumar is offline   Reply With Quote
Old 09-03-2019, 09:18 AM   #4
sxschech
Newly Registered User
 
Join Date: Mar 2010
Posts: 613
Thanks: 28
Thanked 112 Times in 101 Posts
sxschech is on a distinguished road
Re: E-mail criteria

Wasn't sure from your response if you got it working or still need assistance.

Quote:
I have send one email with 4 recipients in the "TO"....
Did you mean "I have sent" or "I have to send"?
sxschech is offline   Reply With Quote
The Following User Says Thank You to sxschech For This Useful Post:
Ravi Kumar (09-03-2019)
Old 09-03-2019, 09:20 AM   #5
Ravi Kumar
Newly Registered User
 
Join Date: Aug 2019
Posts: 86
Thanks: 106
Thanked 0 Times in 0 Posts
Ravi Kumar is on a distinguished road
Re: E-mail criteria

Sorry for the typing error..
It is "I have to send".
Ravi Kumar is offline   Reply With Quote
Old 09-03-2019, 09:23 AM   #6
sxschech
Newly Registered User
 
Join Date: Mar 2010
Posts: 613
Thanks: 28
Thanked 112 Times in 101 Posts
sxschech is on a distinguished road
Re: E-mail criteria

How far along are you in the code or do you not have any code?
sxschech is offline   Reply With Quote
The Following User Says Thank You to sxschech For This Useful Post:
Ravi Kumar (09-03-2019)
Old 09-03-2019, 07:20 PM   #7
Ravi Kumar
Newly Registered User
 
Join Date: Aug 2019
Posts: 86
Thanks: 106
Thanked 0 Times in 0 Posts
Ravi Kumar is on a distinguished road
Re: E-mail criteria

sir,
I Do not have nay code

Ravi Kumar is offline   Reply With Quote
Old 09-03-2019, 11:33 PM   #8
Gasman
Enthusiastic Amateur
 
Gasman's Avatar
 
Join Date: Sep 2011
Location: Swansea, South Wales,UK
Posts: 4,522
Thanks: 441
Thanked 841 Times in 812 Posts
Gasman is a jewel in the rough Gasman is a jewel in the rough Gasman is a jewel in the rough
Re: E-mail criteria

You might want to start here?

https://www.google.com/search?ei=eWh...j0.4p1ctomcFSg
__________________
Access novice. Sometimes trying to give something back.
Access 2007

Please, please use code tag # when posting code snippets

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Gasman is online now   Reply With Quote
The Following User Says Thank You to Gasman For This Useful Post:
Ravi Kumar (09-04-2019)
Old 09-04-2019, 01:19 AM   #9
Ravi Kumar
Newly Registered User
 
Join Date: Aug 2019
Posts: 86
Thanks: 106
Thanked 0 Times in 0 Posts
Ravi Kumar is on a distinguished road
Re: E-mail criteria

sir in this video it is showing sending a particular record to particular recipient or recipients .this I have already done.
my requirements is :
* if my 1st column in report has 2 locations say a and b it should send mail to their department heads (stored in dept heads table,1st column location ,2nd department head mail ID) .
Ravi Kumar is offline   Reply With Quote
Old 09-04-2019, 01:39 AM   #10
Gasman
Enthusiastic Amateur
 
Gasman's Avatar
 
Join Date: Sep 2011
Location: Swansea, South Wales,UK
Posts: 4,522
Thanks: 441
Thanked 841 Times in 812 Posts
Gasman is a jewel in the rough Gasman is a jewel in the rough Gasman is a jewel in the rough
Re: E-mail criteria

If I understand you correctly, and that is a big if, you could use DLookUp to get the 2nd department head mail ID for location a, and the same for b.

You really have given nothing to go on, just generic questions, hence generic answers.

To break it down.
Identify the location.
Get the email id's for that location
Send report

Repeat to each location.

For each email id you would concatenate a ";" at the end of the string, then add the next email id and another ";"

You do not really need the last ";" in a string of email ids, but it works just fine, and for the code to remove that last character, I just leave it as is.

HTH

__________________
Access novice. Sometimes trying to give something back.
Access 2007

Please, please use code tag # when posting code snippets

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Gasman is online now   Reply With Quote
The Following User Says Thank You to Gasman For This Useful Post:
Ravi Kumar (09-04-2019)
Reply

Tags
beginner , email autmation , report , vba

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Criteria for sending mail Ravi Kumar Modules & VBA 12 08-26-2019 04:16 AM
Mail Merge from query with Like criteria Dick7Access Word 1 01-21-2016 08:01 AM
Query Criteria and Variable in E-mail in VBA doupis Modules & VBA 2 09-24-2013 08:20 AM
Mail once again - Opening 'new' mail-window and export mail adress johndoomed General 2 06-24-2006 06:03 AM
send e-mail via query search criteria from access Thomas Johansen Modules & VBA 0 03-17-2006 05:53 AM




All times are GMT -8. The time now is 08:36 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World