<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : CustomProperties: error 440 object no longer valid</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Calendar : CustomProperties: error 440 object no longer valid]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Thu, 28 May 2026 14:02:14 +0000</pubDate>
  <lastBuildDate>Mon, 16 Nov 2009 19:32:11 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=15630</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[CustomProperties: error 440 object no longer valid : I have figured out the problem...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15630&amp;PID=54905&amp;title=customproperties-error-440-object-no-longer-valid#54905</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=5675">Nexxes</a><br /><strong>Subject:</strong> 15630<br /><strong>Posted:</strong> 16 November 2009 at 7:32pm<br /><br />I have figured out the problem that the devs shouldbe aware of. <DIV>&nbsp;</DIV><DIV>IF&nbsp;i pass the VALUE to the customproperty as the recordset object,</DIV><DIV>the SECOND i close the recordset object the CUSTOMPROPRETY gets removed</DIV><DIV>from the collection. I would think that it should not be.</DIV><DIV><BR>What I did to fix the problem is pass the recordset value to a temp variable</DIV><DIV>and now when I pass the variable to set the value of the customproperty it</DIV><DIV>doesnt get destroyed or remove the property when the&nbsp;recordset object is closed.</DIV><DIV>&nbsp;</DIV><DIV>In my ADD EVENT form the code the errored once the form was closed and I</DIV><DIV>tried to access the eventID customproperty I had created is:</DIV><DIV>m_pEditingEvent.CustomProperties.Property("AppointmentID") = nRS.Fields("AppointmentID")<BR></DIV><DIV>To fix it.. do this</DIV><DIV>Dim temPID as long</DIV><DIV>tempid = nRS.Fields("AppointmentID")<BR>m_pEditingEvent.CustomProperties.Property("AppointmentID") = tempID</DIV><DIV>&nbsp;</DIV><DIV>NOW when I add the event and close the&nbsp;recordset and try and access the </DIV><DIV>customproperty from the Event AddedEx or EventchangedEx&nbsp; the AppointmentID customproperty is</DIV><DIV>still in the collection.</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Mon, 16 Nov 2009 19:32:11 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15630&amp;PID=54905&amp;title=customproperties-error-440-object-no-longer-valid#54905</guid>
  </item> 
  <item>
   <title><![CDATA[CustomProperties: error 440 object no longer valid :   This deal is with CUSTOMPROPERTIES...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15630&amp;PID=54861&amp;title=customproperties-error-440-object-no-longer-valid#54861</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=5675">Nexxes</a><br /><strong>Subject:</strong> 15630<br /><strong>Posted:</strong> 15 November 2009 at 4:38pm<br /><br /><DIV></DIV><DIV></DIV><DIV>This deal is with CUSTOMPROPERTIES i need to&nbsp;add to each event object</DIV><DIV>because I want to manually control all data saved to my access database</DIV><DIV>and need the ID of each record.</DIV><DIV>&nbsp;</DIV><DIV>I have two forms frmCalendar which contains the calendar control and </DIV><DIV>the ADD EVENT Form called frmEvent_AddEdit which allows me to create/edit an event.</DIV><DIV>&nbsp;</DIV><DIV>On the calendar dblcick event I call the ADD NEW EVENT form which</DIV><DIV>allows me to add a new event. In that form I create a new event</DIV><DIV>and use the ADD EVENT method of the calendar to add the new event.</DIV><DIV>&nbsp;</DIV><DIV>In the new event I add a custom property AppointmentID to store the ID of the access database record</DIV><DIV>I am also creating manually to store the event in my access database.</DIV><DIV>&nbsp;</DIV><DIV>Here is the Code in the frmEvent_AddEdit that creates the event and adds to calendar.</DIV><DIV>I want to save the event to my internal access daabase triggered byt the EventAddedEx EVENT.</DIV><DIV>&nbsp;</DIV><DIV>Private Sub cmdOk_Click()<BR>&nbsp;&nbsp;&nbsp; If (Not CheckDates()) Then Exit Sub</DIV><DIV>&nbsp;&nbsp;&nbsp; UpdateEventFromControls<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; If m_bAddEvent Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'We have to CREATE A new APPOINTMENTID from adding the new record and create event so it saves it HERE<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim nRS As New ADODB.Recordset<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; With nRS<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .CursorLocation = adUseClient<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .CursorType = adOpenDynamic<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .LockType = adLockOptimistic<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Open "Select * from Appointments where AppointmentID = 0", FIDOCon<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .AddNew<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Fields("subject") = txtSubject.Text<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Update<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End With<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_pEditingEvent.CustomProperties.Property("AppointmentID") = nRS.Fields("AppointmentID")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nRS.Close<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set nRS = Nothing<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; frmCalendar.nakCalendar.DataProvider.AddEvent m_pEditingEvent<BR>&nbsp;&nbsp;&nbsp; Else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; frmCalendar.nakCalendar.DataProvider.ChangeEvent m_pEditingEvent<BR>&nbsp;&nbsp;&nbsp; End If<BR></DIV><DIV>&nbsp;&nbsp;&nbsp; Unload Me<BR>End Sub</DIV><DIV>&nbsp;</DIV><DIV>Code that errors in the frmCalendar form that contains the calendar control on the MSGBOX line (errror 440)</DIV><DIV>&nbsp;</DIV><DIV>Private Sub nakCalendar_EventAddedEx(ByVal pEvent As XtremeCalendarControl.CalendarEvent)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'RUNS WHEN A NEW EVENT IS ADDED TO THE CALENDAR<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MsgBox "pEvent.CustomProperties.Property('AppointmentID')" &amp; pEvent.CustomProperties.Property("AppointmentID")<BR>end Sub</DIV><DIV>&nbsp;</DIV><DIV>As you can see I am creating a new record in my access database and getting the ID</DIV><DIV>and creating the AppointmentID customproperty and storing that in the NEW EVENT.</DIV><DIV><BR>I add the event which triggers the nakCalendar_EventAddedEx which errors saying the customproperty</DIV><DIV>isnt created or exists. Why is this?</DIV><DIV>&nbsp;</DIV><DIV>thanks all</DIV><DIV>Nate Kern</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Sun, 15 Nov 2009 16:38:50 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15630&amp;PID=54861&amp;title=customproperties-error-440-object-no-longer-valid#54861</guid>
  </item> 
 </channel>
</rss>