Hi Hap,
The main requirement is to synchronise so rooms are not double booked, and if that works, the Head of Dept will use the same approach to check for tutor clashes. admin people do not want to include all random room use in the Staff Training database.
The code used to write appointments follows.
It works as it stands, although the lines finding the room bookings folder are commented out in the live version. The db and Outlook run 24/7 on at least one machine.
By linking to the Outlook folder, I can read, partial update and delete.
If I use a flag in the subject, I can determine which records are courses, as opposed to random items, but I can't tell Course A run 1 starting at 9am from Course A, run 2 starting at 2pm. No times are visible at all.
Thanks for any assitance you can give.
Public Sub AddToOutlook(apptSubject As String, Optional apptDescription As String, _
Optional StartDate As Date, Optional StartTime As Date, _
Optional EndTime As Date, Optional apptLocation As String, Optional apptCategories As String)
' Subroutine opens outlook (or grabs it, and puts an
' appointment into the user's calendar.
'
' the user has to copy the item into the public folder!
' This is a pain, but one button writes all upcoming courses from the database
' into the calendar with a new category id. The whole process is about 4 user
' steps and takes about 60 seconds, which has been adequate thus far.
'
' New requirement is for Access and Outlook to be interfaced in such a way that
' any change to either is checked against the other, and changes are reflected in both.
Dim objOutlook As Outlook.Application
Dim olns As Object
Dim objAppt As Outlook.AppointmentItem
Dim MyFolder1 As Object
Dim MyFolder2 As Object
Dim MyFolder3 As Object
' Wake up Outlook or grab hold of it as Outlook should
' only be open once per machine
Set objOutlook = CreateObject("Outlook.Application"

Set olns = objOutlook.GetNamespace("MAPI"
' Create an appointment item. This will appear in the user's
' calendar as so far unable to create in a public folder, even
' if the user is the owner of the public folder
Set objAppt = objOutlook.CreateItem(olAppointmentItem)
' Set a route for the Public folder we want
' These lines find the folder, however can't create a new appointment item
' at present
Set MyFolder1 = olns.Folders("Public Folders"

Set MyFolder2 = MyFolder1.Folders("All Public Folders"

Set MyFolder3 = MyFolder2.Folders("Room Bookings"
' Open the new appointment item, and fill out the fields
With objAppt
' all courses have a subject, a date and times
.Start = StartDate & " " & StartTime
.Duration = (EndTime - StartTime) * 24 * 60
.subject = apptSubject
If Not IsNull(apptDescription) Then .body = apptDescription
If Not IsNull(apptLocation) Then .location = apptLocation
If Not IsNull(apptCategories) Then .categories = apptCategories
'save the appointment, and then close it, saving again for good measure!
.Save
.Close olSave
End With
End Sub