MS-Outlook Appointments form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello everybody,

Is there any way to create a form to record appointments using a form like
the MS-Outlook built-in form for appointments?

I need to record data in the database and not in MS-Outllook

Thanking you in advance,

George ([email protected])
 
What *SPECIFCIALLY* are you trying to do? It is entirely possible to use
Outlook to capture information and drop it into a database and as my
last post demonstrates take a record from a DB and create an
AppointmentItem in Outlook.

This code demonstrates how Outlook can update a record in an Access
database. Specifically, when an AppointmentItem's date/time is changed
by either click and drag on a calendar or by displaying it using the
AppointmentItem form, the corresponding record is updated in Access.
Note that its provided as an example only.

Private Sub myOlItems_ItemChange(ByVal Item As Object)

Dim objAccess As Object
Dim db As DAO.Database
Dim rs As DAO.Recordset

DoCmd.Hourglass True
If Item.Class = olAppointment And Item.MessageClass =
"IPM.Appointment.Reservations" Then
If IsNull(Item.UserProperties("dbAccessID")) = False Then
If Item.UserProperties("dbAccessID") = 0 Then
MsgBox "Unable to update Access. Invalid Transport Id."
Exit Sub
End If
Set objAccess = CreateObject("Access.Application")
Set db = objAccess.DBEngine.OpenDatabase("C:\Documents and
Settings\dch3\My Documents\Willard Madison\Data\Access\WMS FrontEnd
2005.mdb")
Set rs = db.OpenRecordset("SELECT * FROM tblTransports
WHERE lngTransportID = " & Item.UserProperties("dbAccessID") & ";")
If Not rs.EOF Then
rs.Edit
rs.Fields("dteDate") = FormatDateTime(Item.Start,
vbShortDate)
rs.Fields("dteTimeScheduled") =
FormatDateTime(Item.Start, vbShortTime)
rs.Update
MsgBox ("Transport #" &
Item.UserProperties("dbAccessID") & " updated.")
Else
MsgBox ("Unable to update Transport #" &
Item.UserProperties("dbAccessID") & ". Record may have been deleted.")
End If
rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
Set objAccess = Nothing
End If
End If
DoCmd.Hourglass False

End Sub
 
Back
Top