473,508 Members | 2,032 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to send an automatic birthday warning by Outlook 2007 e-mail?

4 New Member
Hi,
I am new to DB and I have to use Access 2007, at the company, we have a database with a table that has employee's information such as DOB, I would like to send an automatic e-mail to their supervisor 3 to 5 days before to let the supervisor send a Birthday card.
How can I do that?? I think it can be done automatically using auto macro or similar.
Can you help me?? Please do not forget I am fairly new to DB. I know VBA for Excel and Excel very well, but this has to work with Access.
Thank you in advance
Jan 24 '11 #1
10 5571
TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
Hey, and welcome to Bytes

Im sure there are several ways to do this, but the approach that springs to mind for me, is to have a simple form with a timer attached (Timer adjusted to run every 24 hours). The timer in an access form is basicly a trigger for running code.

You can then attach code to the timer event, which checks a table to see if any birthdays will occur 5 days from now, and then send an email. I haven't really worked with sending emails from access, but there are several good posts about that specific part.

I or someone else can probably detail some of the steps more, if you need.
Jan 25 '11 #2
NeoPa
32,557 Recognized Expert Moderator MVP
As the question is unfortunately so broad in scope, I suggest we deal here only with the concept of triggering the process, which will deal with sending a message, probably via email, to the relevant supervisor. Sending an email you can ask about separately (or search for solutions as there are already so many of them available on this site alone).

Smiley's suggestion is workable, but does rely on the database to be running somewhere all/most of the time. An alternative is for a database to run a check on startup, of a query that displays all birthdays approaching within the next three days. If any are found then the process can be triggered and fire off whatever to all relevant supervisors. This approach would rely on the database being run at least once daily.
Jan 25 '11 #3
Rabbit
12,516 Recognized Expert Moderator MVP
I've done automation of Outlook before and there's something you need to be aware of. If you try to access outlook to send e-mail, it will prompt you, you must wait 5 seconds before you can click the prompt, and it will ask you how long you want to give access to outlook.

If that is not acceptable, you will have to use some other third-party .dll to get it done.
Jan 25 '11 #4
Guy Choquette
4 New Member
Thank you all. I like your ideas, but as I am not an expert, I think the first step would be to have that query to display all birthdays, but once i have the query with the Birth Date, How do I get it to let me know of all the birthdays coming in the next 5 days??? Once I have that list, I am sure I could display it first and then I will work on sending the mail.
Thank you for helping me, all your ideas are good. I appreciate.
Jan 25 '11 #5
Rabbit
12,516 Recognized Expert Moderator MVP
Use the WHERE condition and add a date condition where the date has to be between today and today plus 5 days from now. You can use the DateAdd function to add the 5 days.
Jan 25 '11 #6
NeoPa
32,557 Recognized Expert Moderator MVP
... and you can use the Weekday() function to determine whether or not a weekend will fall within that periods in order to vary the number of days forward you need to look (so 3 or 5 becomes x, which is determined by checking Weekday().). Personally, I would filter the list by Date() + 2 to x, rather than simply Date() (==> today), otherwise you'll get repetitions across the period, which may prove a nuisance.
Jan 26 '11 #7
Guy Choquette
4 New Member
Thanks you to all, I am progressing, I made a query with the employee table, then I have put this expression in the next empty field:
Expand|Select|Wrap|Line Numbers
  1. expr1: DateSerial(Year(Date())+IIf(Month([DOB])*100+Day([DOB])<=Month(Date())*100+Day(Date()),1,0),Month([DOB]),Day([DOB]))
that I took on a forum, and it gives me the Anniversary date.
Now I have put this criteria and it gives me what I want: Date() +3, I will be able to add in one of the column the supervisor e-mail, to be able to send from there a warning e-mail...
Should I be able to create this query in a macro that would start as soon as I open the DB, if yes, then I should be able to also add the code for the outlook e-mail, should I???? Some one has an idea of the code?? and where should I put that macro
Thank you again to ALL of you.
Jan 26 '11 #8
NeoPa
32,557 Recognized Expert Moderator MVP
Guy, I touched on this earlier, but you seem to have allowed the message to go by unheeded :
You are not allowed to ask multiple questions in the same thread. Each thread should have a single topic.

Details about how to email something from Access, and how to get code to run automatically, are for other threads. Both topics have already been covered exhaustively already, so you needn't, unless you choose to take that course, ask a separate question on either of these topics, or put yourself in the position of having to wait for replies. These topics certainly cannot be covered in this thread though.

I can answer the latter question as far as saying that it is certainly possible, if that helps any. The details of the topics though, are for other threads than this.

These threads may help. Otherwise see below for the search keywords I used.
Problem with e-mailing from within Access
Invoking a Database From the Command Line

I searched through bytes using keywords of smtp & vba and separately on autostart vba.
Jan 27 '11 #9
Guy Choquette
4 New Member
Thank you for the help you gave me.
SInce it is not the right place, I will search some where else.
Jan 27 '11 #10
NeoPa
32,557 Recognized Expert Moderator MVP
Guy, I'm not suggesting you cannot ask about these matters in threads you post yourself. Simply that they should each be in their own thread if you do, and that it will probably be a slower way of getting the information you need than searching through the existing threads. If it is your choice to post new threads on these questions though, please go ahead and do so. We have no problems with that.
Jan 28 '11 #11

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

Similar topics

4
15040
by: Brian Hampson | last post by:
I recently upgraded to Outlook 2007 B2TR and have found that I can no longer code against MAPI.DLL It's gone :( Using C#, I used to get the MAPI session, and from that I could change the out of...
8
4830
by: mc | last post by:
I would like to be able to send from an ASP.NET page an email which when recieved takes the form of a "Sharing Invitation for a RSS Feed"...
1
1972
by: yousry | last post by:
Hi fellows, I want to customize the dialog box that appears when you double click any entry in the address box dialog in outlook 2007. I searched the web with many saerch keys but no luck. ...
2
2423
by: Brad Isaac | last post by:
Hi, I have a working app that uses interop.outlook.dll to export items to Outlook calendar. I downloaded the Primary Interop Assemblies for Office 2k7 today and still cannot get a working...
0
1020
by: =?Utf-8?B?bmpkbWVsbG8=?= | last post by:
Hi, I am trying to use the visual studio express environment to create a simple combobox on a windows form that is "databound" to the categories available in outlook 2007. I am able to create...
0
1268
by: John | last post by:
Hi An outlook 2003 add-in solution created in vs 2008 on a pc with outlook 2007 when re-opened in vs 2008 brings up the conversion wizard. Cancelling wizard closes solution and does not allow to...
0
1320
by: jmartmem | last post by:
Greetings, I have an Outlook 2007 task that I saved from an Access 2007 database. Specifically, the task contains a "Run Export" command button in the Access group to export an Access report into...
21
14793
by: farisallil | last post by:
Hi I have a table called Info with a column called Email Address in it. I want to create a command button in a form called Customer ,which has the Info table as the Record Source, and I want this...
0
1366
by: Dave Waine | last post by:
If I right click on a .jpg file and select 'send to email recipient' I am asked if I want to reduce file size but Windows doesn't then open Outlook 2007 to send the file (as an attachment). {Windows...
7
4167
by: MyWaterloo | last post by:
I am currently using this code to send an appointment to Outlook. It sends the info to a form called "frmAppointments" and then to Outlook. This code works great to send the record that is in focus. ...
0
7127
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7331
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
7391
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
7054
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...
1
5056
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4713
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
3204
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1564
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 ...
0
424
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.