This deal is with CUSTOMPROPERTIES i need to add to each event object
because I want to manually control all data saved to my access database
and need the ID of each record.
I have two forms frmCalendar which contains the calendar control and
the ADD EVENT Form called frmEvent_AddEdit which allows me to create/edit an event.
On the calendar dblcick event I call the ADD NEW EVENT form which
allows me to add a new event. In that form I create a new event
and use the ADD EVENT method of the calendar to add the new event.
In the new event I add a custom property AppointmentID to store the ID of the access database record
I am also creating manually to store the event in my access database.
Here is the Code in the frmEvent_AddEdit that creates the event and adds to calendar.
I want to save the event to my internal access daabase triggered byt the EventAddedEx EVENT.
Private Sub cmdOk_Click() If (Not CheckDates()) Then Exit Sub
UpdateEventFromControls If m_bAddEvent Then 'We have to CREATE A new APPOINTMENTID from adding the new record and create event so it saves it HERE Dim nRS As New ADODB.Recordset With nRS .CursorLocation = adUseClient .CursorType = adOpenDynamic .LockType = adLockOptimistic .Open "Select * from Appointments where AppointmentID = 0", FIDOCon .AddNew .Fields("subject") = txtSubject.Text .Update End With m_pEditingEvent.CustomProperties.Property("AppointmentID") = nRS.Fields("AppointmentID") nRS.Close Set nRS = Nothing frmCalendar.nakCalendar.DataProvider.AddEvent m_pEditingEvent Else frmCalendar.nakCalendar.DataProvider.ChangeEvent m_pEditingEvent End If
Unload Me End Sub
Code that errors in the frmCalendar form that contains the calendar control on the MSGBOX line (errror 440)
Private Sub nakCalendar_EventAddedEx(ByVal pEvent As XtremeCalendarControl.CalendarEvent) 'RUNS WHEN A NEW EVENT IS ADDED TO THE CALENDAR MsgBox "pEvent.CustomProperties.Property('AppointmentID')" & pEvent.CustomProperties.Property("AppointmentID") end Sub
As you can see I am creating a new record in my access database and getting the ID
and creating the AppointmentID customproperty and storing that in the NEW EVENT.
I add the event which triggers the nakCalendar_EventAddedEx which errors saying the customproperty
isnt created or exists. Why is this?
thanks all
Nate Kern
|