Solved

Add tickler to Access file that automatically emails timed reminders to certain users

Posted on 2011-02-11
7
1,905 Views
Last Modified: 2012-05-11
Hello,
I have created an Access database (version 2007) that is used and frequently updated by several staff members in the office.  In addition to the updated records, there is a list of associated staff members for each record or type of records. In one field there is a frequency of activity listing (Ex.: weekly, monthly, quarterly, etc.) with a start and end date field.

We would like some type of automatic reminder system that looks in the proper field and automatically generates an email message to all staff members listed on the record to remind them to update the database for that record at a given time.  We all use Outlook as the email system.  Each associated user's email address is listed in a field on each record. Can this be done and if so, how.  If possible, we'd like a cc: to also be sent to the group manager and supervisor.

A separate table listing the associated staff mamberss' names, email addresses, etc. can be made if you think that is best.

I will create any necessary fields to put on the form and make several separate email address fields rather than one, if necessary.  Each record in the table has its own list of associated staff members who should be reminded of a due date.

Thank you for any assistance that you can give.

0
Comment
Question by:sherman6789
  • 4
  • 3
7 Comments
 
LVL 31

Accepted Solution

by:
Helen_Feddema earned 500 total points
ID: 34872573
I just wrote an Access Archon article on this topic.  It has a sample database that creates emails to be sent at a future date.  You can adapt the sample database for your needs.  Here is a link for downloading it:

http://www.helenfeddema.com/Files/accarch204.zip
0
 
LVL 31

Expert Comment

by:Helen_Feddema
ID: 34872606
Here is the Access code that creates tasks with reminders, and the Outlook event procedure that creates the emails when the reminders fire:
Public Sub CreateReminder(dteReminder As Date, strEmployeeName As String, _
   strEmail As String)
'Created by Helen Feddema 27-Dec-2010
'Last modified by Helen Feddema 28-Dec-2010

On Error GoTo ErrorHandler

   Dim appOutlook As New Outlook.Application
   Dim tsk As Outlook.TaskItem
   Dim strMessage As String
   
   'Create task item for sending the mail message later
   strMessage = "When the task reminder fires, an email message will " _
      & "be created and sent"

   Set tsk = appOutlook.CreateItem(olTaskItem)
   With tsk
      .Display
      .Subject = "Time Sheet Reminder"
      .DueDate = dteReminder
      .StartDate = dteReminder
      .Categories = "Reminder"
      .Body = strMessage
      
      'Store info for mail message in unused Task fields
      .BillingInformation = strEmail
      .Mileage = "Please submit a signed time sheet for last week by end of work today"
      .CardData = "Time sheet reminder"
      
      'Set task reminder for date when message should be sent
      .ReminderSet = True
      .ReminderTime = dteReminder
      .Close (olSave)
   End With
   
   strTitle = "Information"
   strPrompt = "Task created; when the task reminder fires, an email message will " _
      & "be created and sent"
   MsgBox prompt:=strPrompt, _
      buttons:=vbInformation + vbOKOnly, _
      Title:=strTitle
   
ErrorHandlerExit:
   Set appOutlook = Nothing
   Exit Sub

ErrorHandler:
   MsgBox "Error No: " & Err.Number _
      & " in CreateReminder procedure; " _
      & "Description: " & Err.Description
   Resume ErrorHandlerExit

End Sub

=========================

Private Sub Application_Reminder(ByVal Item As Object)
'Created by Helen Feddema 28-Dec-2010
'Last modified by Helen Feddema 28-Dec-2010

On Error GoTo ErrorHandler

   Dim msg As Outlook.MailItem
   
   If Item.Categories = "Reminder" Then
      Set msg = Application.CreateItem(olMailItem)
      With msg
         .To = Item.BillingInformation
         .Subject = Item.CardData
         .Body = Item.Mileage
         .BodyFormat = olFormatPlain
         .Save
      End With

   End If
   
   'Uncomment the following line to display the mail message
   'msg.Display
   msg.Send
   
ErrorHandlerExit:
   Exit Sub

ErrorHandler:
   MsgBox "Error No: " & Err.Number _
      & " in Application_Reminder procedure; " _
      & "Description: " & Err.Description
   Resume ErrorHandlerExit

End Sub

Open in new window

0
 

Author Comment

by:sherman6789
ID: 34872712
To: Helen_Feddema:

Thank you for your prompt reponse to my question.  This looks great; however, I am probably not knowledgable enough to use it right away and understand the major parts of it.  The code should be placed where.  How is it triggered?  Does someone open the database and click a button then the program evaluates the reminder date then determines when and if a message should be sent?  Do I put the email addresses in a particular field or fields.  

The staff members who will look at the database will input update information in a given record.  If the reminder date "hits", the program will send a message to all of the people on the list for that particular record only and not to everyone.  I hope that this makes sense.  If it does not, I will re-word it.

Thanks again.
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

Author Comment

by:sherman6789
ID: 34962381
Thanks to Helen_Feddema,

I am about to close this thread and I believe you have supplied me with the information and examples that I need to complete the project.  I am still studying the information but have to work on other projects at the same time.  Rather than keep the thread open, I am awarding the points to you with my sincere appreciations.  I will probably get back to this project within two weeks.  If I have a clarification question, I will try to post it then.

Thanks Again,
WRS
0
 

Author Closing Comment

by:sherman6789
ID: 34962466
Your solution is excellent.  I will reply as soon as I am able to return to this task within two weeks.
Thanks.

WRS
0
 
LVL 31

Expert Comment

by:Helen_Feddema
ID: 34962540
In the sample database, there is a Create Reminder button on a form that fires the procedure.  You would need to modify the code to first create a filtered recordset, including just the employees who need the remainder, for use in the CreateReminders procedure.  You could also call CreateReminders from (say) the AfterUpdate event of a form, or perhaps BeforeUpdate, with a confirmation message.
0
 

Author Comment

by:sherman6789
ID: 34963627
Thank you.

I am capturing all of this information and will try to use it within the next two weeks.  I appreciate your inputs and feel that I will be able to succeed in completing this project.

WRS
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many companies are making the switch from Microsoft to Google Apps (https://www.google.com/work/apps/business/). Use this article to learn more about what Google Apps has to offer and to help if you’re planning on migrating to Google Apps. It is …
The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now