473,385 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

add multiple records in one outlook reminder (from microsoft access database)

is it possible to add multiple records in one Outlook Reminder? I need to set an Outlook task reminder containing list of workers who need to extend their working contracts three months before it reach its limit date.

This reminder will collectively pick the workers who need to extend their contracts and be appear in the 1st day of certain month (approximately three months before their contracts end).

I was about to set one reminder for each worker, but it turned out confusing as we have so many workers in the record.

What should I do with this? I'm thinking about using Record-set, but I have no idea how to put it on my code.

Thanks!
Jul 7 '15 #1
6 1922
zmbd
5,501 Expert Mod 4TB
Sorry,
Records in Outlook? Although it is basically a front-end to a database, one doesn't usually mess with the underlying database without risking corruption of either the exchange-server or the PST.

Normally one would create an meeting, or a task and add the users to that object or one can create one item in the calendar and forward that item to multiple recipients.

I personally have set up groups in my contacts and then create a task or a meeting and add the group to the item or forward the calendar item to the group.

Can you be a lot more detailed about what you are attempting to do and how you are attempting to do this?
Jul 7 '15 #2
@zmbd hello, thanks for your reply.
I'm working on an access database, creating an application with reminder function. I use outlook as the reminder tools, so I put some code on Access to set outlook task reminder and it will pop up when the schedule meets its due date.
Basically, I have a table containing these fields : Employee_Number, Employee_Name, and Task_Due.
At first, I set one reminder for each record. But it turns out confusing since there are so many records in the table. My supervisor suggested me to group the reminder per month, so the outlook reminder only appear in the first day of each month. My idea is to make a single outlook reminder containing list of employees who have task due in the same month, so there will be no excessive load of reminders on the first day of the month.

Can I do it?

*I'm sorry for my broken English*
Jul 10 '15 #3
jforbes
1,107 Expert 1GB
That sounds reasonable. If you would post a copy of your code, we might be able to tell you what changes might make it work for you.
Jul 10 '15 #4
zmbd
5,501 Expert Mod 4TB
First thing to do, is read thru our Application Automation Insights Article to get a general feel about how to work with Outlook.

Now take a look here:
How to: Create an Appointment as a Meeting on the Calendar

You will do this from within access using your recordset. If you early-bind as given in the fist link (add the reference to Outlook) then you should have the constants such a olAppointmentItem; however, you might find it better in the long run to late-bind your code which requires a bit more effort but can save you some headaches when distributing the application.

See how you progress and post your code ... please read thru the > Before Posting (VBA or SQL) Code and our own VBA Insights articles for some tips on troubleshooting VBA.
Jul 10 '15 #5
here's some sneak-peek of the code I wrote before :

Expand|Select|Wrap|Line Numbers
  1. Private Sub Expired_AfterUpdate()
  2. Dim outLookApp As Outlook.Application
  3. Dim outLookTask As Outlook.TaskItem
  4.  
  5. Set outLookApp = CreateObject("outlook.application")
  6. Set outLookTask = outLookApp.CreateItem(olTaskItem)
  7. countMonth = MonthName(Month(Task_Due))
  8. countYear = Year(Task_Due)
  9.  
  10. With outLookTask
  11.     .Subject = "Task Alert!!"
  12.     .Body = "Task alert for : " & Me.Employee_Name & ". Please submit your task prior to this following due date : " & countMonth & " " & countYear & ". Thank You!"
  13.     .ReminderSet = True
  14.     .Duedate = Me.Task_Due
  15.     .Assign
  16.     .ReminderTime = DateSerial(Year(Task_Due), (Month(Task_Due)) - 6, 1)
  17.     .Save
  18.  
  19. End With
  20.  MsgBox "Task has been set in Outlook succesfully", vbInformation, "Set Task Confirmed"
  21. End Sub
it works well and the reminder appeared.. is there anything I have to improve?
can I have more information about using recordset in this kind of case? I never use recordset before..
thank you...
Jul 13 '15 #6
zmbd
5,501 Expert Mod 4TB
Ok,
You would open the recordset and then move thru using a loop adding the field value... Now using the information from the link on creating an appointment:

So using the information from the link on creating an appointment:
Expand|Select|Wrap|Line Numbers
  1. Set myRequiredAttendee = myItem.Recipients.Add("Nate Sun") 
  2.  myRequiredAttendee.Type = olRequired 
  3.  
so the standard method I use is to build the query in the code; however, if you have a stored query that is just fine.

so something like this (warning air code - I've not ran this against outlook and the end user will need to add the outlook object and other code)

Now this would add (should) multiple attendees to a single task item because you create the task item first and then add the attendees.
Expand|Select|Wrap|Line Numbers
  1. Sub exampleloop()
  2.     Dim zdb As DAO.Database
  3.     Dim zrs As DAO.Recordset
  4.     Dim zSQL As String
  5.     Dim zAttende As String
  6.     '
  7.     'you'll need other variables
  8.     'for your Task object ofcourse
  9.     '
  10.     On Error GoTo zerrortrap
  11.     '
  12.     zSQL = "SELECT tbl1.pk, tbl1.somefield FROM tbl1"
  13.     'this is just placeholder you could use the name of a query you made and saved from the query editor
  14.     'such as zSQL= "qry_appointmentsto"
  15.     ' 
  16.     Set zdb = CurrentDb
  17.     Set zrs = zdb.OpenRecordset(Name:=zSQL, Type:=dbOpenForwardOnly)
  18.     'Note here, I've only opend for foward only, we're starting at the first record and not editing so this works just fine.
  19.     'you could open dbOpenDynamic if you needed to update a record
  20.     '
  21.     'build your outlooktask object first!
  22.     'Once bult then we can use the recordset we just opened
  23.     If zrs.RecordCount Then
  24.     'If there are any records then the result will be greater than 0 which evaluates to true
  25.         Do
  26.             zAttende = zrs![FieldWithTheReceipentsEmailorName]
  27.             'you may need to do something like
  28.             ' "'" & zrs![fldname] & "'"
  29.             '
  30.             'cut and paste from the above example
  31.             Set myRequiredAttendee = myItem.Recipients.Add(zAttende)
  32.             myRequiredAttendee.Type = olRequired
  33.             zrs.MoveNext
  34.             '
  35.         Loop Until zrs.EOF
  36.     '
  37.     'other code
  38.     'cleanup - if you set it, clear it, if you open it, close it
  39.     If Not myRequiredAttendee Is Nothing Then Set myRequiredAttendee = Nothing
  40.     If Not myItem Is Nothing Then Set myItem = Nothing
  41.     If Not zrs Is Nothing Then
  42.         zrs.Close
  43.         Set zrs = Nothing
  44.     End If
  45.     If Not zdb Is Nothing Then Set zdb = Nothing
  46. '
  47. Exit Sub
  48. zerrortrap:
  49. 'I use much more detailed error traps; however this would be the most basic.
  50. 'In production, I would have at least a table to store date/time, module, event, etc...
  51.     Debug.Print ">>" & Err.Number & " - " & Err.Description
  52.     Resume Next
  53. End Sub
so... incorporate your code into the above... let us know what happens. :)
Jul 14 '15 #7

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

Similar topics

9
by: BCS | last post by:
I have a web site in which the site administrator can input information to a database through a web form. The information then gets displayed on ASP pages. One field is a large text field. Of...
6
by: Noozer | last post by:
We've created a new database and need to import the data from our old database. Both are MS Access databases and each have multiple tables. The table structure of each table is completely different...
12
by: Wadim Grasza | last post by:
I want to store and display (on a form or a report) multiple pictures per record in an access database. The pictures are not stored within the database. They are stored as files and the database...
1
by: Michael Meckelein | last post by:
Hi, My csharp application access a MS Access database through odbc connection. Is there a way to compact the Access database after deleting records using the odbc connection?
3
by: Rob Hill | last post by:
I am using Microsoft Access as a prototype for a database application that will eventually be rewritten in VB.NET. I would like to use Access for prototyping future versions of the application. ...
5
by: davepisarek | last post by:
I am looking for a quick and dirty way to create a hyperlink that will open a Microsoft access database written in asp.
5
by: rajaaryan44 | last post by:
how can we transfer data from one access database to another databse . the table name is same for both the database . in one table some records are there (rs say e.g.) now another table has say...
1
by: Brit | last post by:
I have an ASP file that retrieves names from an Access database for 4 different categories of membership, which the visitor to the page selects (corporate, institutional, regular, or student). The...
2
by: Medaron | last post by:
I am trying to wite a vba code to read all my outlook task fields in Access database. So far I have following code: Sub OutlookTasks() Dim ol As Object Dim olns As Object Dim objFolder As...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...

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.