How can i create a reminder in Access!?

How can i create a reminder in access to remind the responsible employee.. for example, the order or task deadline is on 16/april.2009. an email or a popup message will start every time he logs into the file or an email would be sent to him..

mwaelAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
NicholasSmithConnect With a Mentor Commented:
you'll need to reference the msoutl.olb object from your MS Office directory in program files first. if you get any problems with this then let me know
Public Sub AddCalendarEvent(ByVal datDateToCall As Date, ByVal strSubject As String, ByVal strRetailerName As String, _
 ByVal strContactName As String, ByVal strPhoneNumber As String)
  Dim objOutlook      As Outlook.Application
  Dim objNameSpace    As Outlook.NameSpace
  Dim objFolder       As Outlook.MAPIFolder
  Dim objAppointment  As Outlook.AppointmentItem
  
  'If you start Microsoft Outlook, run a second program that accesses Outlook, and then exit Outlook while
  'you still have the second program running on your computer, you may receive an error message that is
  'similar to the following: The remote server machine does not exist or is unavailable (error 462)
 
  On Error Resume Next
  Set objOutlook = Outlook.Application
  
  If Err.Number = 462 Then
    'reinitializes the Outlook object model if above error occurs
    Set objOutlook = CreateObject("Outlook.Application")
    Err.Clear
  End If
  
  On Error GoTo err_AddCalendarEvent
  Set objNameSpace = objOutlook.GetNamespace("MAPI")
  'Set objFolder = GetOutlookCalendarFolder
  
  Set objAppointment = objOutlook.CreateItem(olAppointmentItem)
  With objAppointment
    .ReminderMinutesBeforeStart = 0
    .Start = datDateToCall
    .End = datDateToCall
    .Subject = strSubject & ": " & strRetailerName
    .Body = "Please Call..." & vbCrLf & vbCrLf & _
     "Retailer: " & strRetailerName & vbCrLf & _
     "Contact Name: " & strContactName & vbCrLf & _
     "Phone Number: " & strPhoneNumber 
    .Save
  End With
  
exit_AddCalendarEvent:
  On Error Resume Next
  Set objAppointment = Nothing
  Set objOutlook = Nothing
  Set objNameSpace = Nothing
  Set objFolder = Nothing
  Exit Sub
  
err_AddCalendarEvent:
  MsgBox Err.Number & " " & Err.Description, vbCritical + vbOKOnly, "Error creating Calendar Event"
  Err.Clear
  Resume exit_AddCalendarEvent
End Sub

Open in new window

0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
How do you determine the ResponsibleEmployee, and how do you "match" that person to the person currently viewing the database? You can get the Windows Username of the machine the user is using, but if you do not have those Usernames matched to the ResponsibleEmployee, then there's no way for Access to know which of your Employees is logged in.

If you could tell us a bit more about your setup, we could help further.

FWIW, it's pretty simple to show a message to the user:

Msgbox Me.TaskName & " is due on " & Me.TaskDueDate & " and has been assigned to you."

Something like this could be run from a Form (the Me.TaskName and Me.TaskDate are fictitious names; you'd have to change them to match your project).
0
 
mwaelAuthor Commented:
yes im assigning a user name and pass for every user and im creating a table for our employee.but still hinking how to link that :S
0
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

 
Eric ShermanAccountant/DeveloperCommented:
Here's one approach ...

1.) Build a Task Table that has the user name, task and task details (date created, date due, etc.).

2.) Build a Reminders form where the Record Source is your Task Table and set it to Modal so that it will keep the focus until closed.

3.) Set an Open Event of your main form to open the Reminders form with a where clause ... "[user_name]='" & CurrentUser() & "'"

This will open the Reminders showing all tasks that has been assigned to the current user each time he/she opens the application.  The Modal setting will force them to close the reminder before they can continue.

Just an idea ...

ET
0
 
NicholasSmithCommented:
if you have MS Access installed, what email tool are you using? Is it MS Outlook? If so then I can provide some code to automate the creation of calendar events
0
 
mwaelAuthor Commented:
yes im using ms outlook
0
 
mwaelAuthor Commented:
so this where should i put it? in a new module?or what?
0
 
NicholasSmithCommented:
it would go in a new module if you want to access it from other forms or subroutines
0
 
mwaelAuthor Commented:
ok i inserted it into new module
then?
0
 
mwaelAuthor Commented:
im so bad in modules amcros and codes
0
 
NicholasSmithCommented:
The line:

AddCalendarEvent date(), "call Back", "Joe Bloggs Enterprises", "Mr Bloggs", "0800 100 100"

would then add the record using the above parameters from any piece of code.

NOTE: you do need a reference to MSOutl.olb which is found in the Office10 directory of your Microsoft Office installation
0
 
mwaelAuthor Commented:
:S
 
please can we do it step by step?
ok.. o add the first codes in a module.. then i have to add the above line to it?
so afterthat the reponsiple employee will recieve an email automaticlly?
0
 
NicholasSmithCommented:
if you are unsure how to implement the above code into an application then what i'd be doing is pretty much writing it all for you which would then become a larger task as opposed to offering some guidance in the right direction.
0
 
mwaelAuthor Commented:
then?
it ok.. u can do it! i need only tips
 
i refrenced the outlook in access.. and i inserted the codes in the module
 
then?
0
 
NicholasSmithCommented:
if you inserted the code in to your modules and referenced the outlook object then the line:

AddCalendarEvent date(), "call Back", "Joe Bloggs Enterprises", "Mr Bloggs", "0800 100 100"

would add a call back for today for Mr Bloggs of Joe Bloggs Enterprises to call back on 0800 100 100.

obvuiously you would use your own parameters based on whatever criteria you are using.

this call back is added to microsoft outlook into the calendar and will prompt the user as a normal calendar event would. there is no further help that you need
0
 
mwaelAuthor Commented:
ok thnx dear.. :)
0
 
mwaelAuthor Commented:
it keeps giving me error!
 
i called the module i built but..
0
 
mwaelAuthor Commented:
r u sure it sends email to responsiple employee?
0
 
NicholasSmithCommented:
it wont create an email but would pop up as a calendar event on the outlook of the person who created the event
0
 
mwaelAuthor Commented:
aha... great.. but i have many many may users.... will that be possible in this case?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.