Go Back   Access World Forums > Microsoft Access Discussion > Reports

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 06-06-2019, 03:43 AM   #1
Jonny
Newly Registered User
 
Join Date: Aug 2005
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
Jonny is on a distinguished road
Managing Dynamic Emails in EMailDatabaseObject

I have a query that alerting once an employee has a birthday.
Now I wish that "..wishes" report will be sent to that employee.

I can put in AutoExec only static email , a@b.com but not relevant employee email from a table..
Attached Images
File Type: jpg Capture.JPG (67.1 KB, 10 views)


Last edited by Jonny; 06-06-2019 at 03:59 AM.
Jonny is offline   Reply With Quote
Old 06-06-2019, 04:08 AM   #2
theDBguy
Iím here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 3,040
Thanks: 36
Thanked 722 Times in 705 Posts
theDBguy will become famous soon enough theDBguy will become famous soon enough
Re: Managing Dynamic Emails in EMailDatabaseObject Macros

Hi. I think what you’ll have to do is use SetLocalVar and maybe use DLookup or SearchForRecord to get the email from the table. You can then use the LocalVar in your macro.
__________________
Just my 2 cents...

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.
theDBguy is offline   Reply With Quote
Old 06-06-2019, 05:58 AM   #3
Jonny
Newly Registered User
 
Join Date: Aug 2005
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
Jonny is on a distinguished road
Re: Managing Dynamic Emails in EMailDatabaseObject Macros

Quote:
Originally Posted by theDBguy View Post
Hi. I think what youíll have to do is use SetLocalVar and maybe use DLookup or SearchForRecord to get the email from the table. You can then use the LocalVar in your macro.
Could you please help with the syntax? The DB is attached.
Attached Files
File Type: accdb test1.accdb (596.0 KB, 10 views)

Jonny is offline   Reply With Quote
Old 06-06-2019, 07:07 AM   #4
theDBguy
Iím here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 3,040
Thanks: 36
Thanked 722 Times in 705 Posts
theDBguy will become famous soon enough theDBguy will become famous soon enough
Re: Managing Dynamic Emails in EMailDatabaseObject Macros

Quote:
Originally Posted by Jonny View Post
Could you please help with the syntax? The DB is attached.
Hi. Unfortunately, I'm not really good with macros. Would you like to have a VBA solution instead?
__________________
Just my 2 cents...

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.
theDBguy is offline   Reply With Quote
Old 06-06-2019, 12:12 PM   #5
Jonny
Newly Registered User
 
Join Date: Aug 2005
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
Jonny is on a distinguished road
Re: Managing Dynamic Emails in EMailDatabaseObject Macros

Quote:
Originally Posted by theDBguy View Post
Hi. Unfortunately, I'm not really good with macros. Would you like to have a VBA solution instead?
Yes, sure.. please.
Jonny is offline   Reply With Quote
Old 06-06-2019, 12:36 PM   #6
theDBguy
Iím here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 3,040
Thanks: 36
Thanked 722 Times in 705 Posts
theDBguy will become famous soon enough theDBguy will become famous soon enough
Re: Managing Dynamic Emails in EMailDatabaseObject Macros

Quote:
Originally Posted by Jonny View Post
Yes, sure.. please.
Okay, you could try the following:
Code:
Dim strEmail As String


strEmail = Nz(DLookup("e-mail","Query1"),"")


DoCmd.SendObject acSendNoObject, , , strEmail, , , "Subject", "Message Body", True

__________________
Just my 2 cents...

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.
theDBguy is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Access used to sent emails from Lotus Notes emails not saved in Sent folder. Ajit Singh Modules & VBA 1 02-07-2016 10:55 PM
EmailDatabaseObject rwm75 General 4 12-29-2015 06:30 AM
[SOLVED] EmailDatabaseObject Eljefegeneo Macros 3 01-25-2015 11:51 PM
EmailDatabaseObject - Help!? MI01KXR Modules & VBA 0 05-06-2014 09:28 AM
Managing Contact Emails PhillPaige General 2 09-18-2012 06:06 AM




All times are GMT -8. The time now is 09:06 PM.


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