Print Page | Close Window

Remove Schedule

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=7171
Printed Date: 27 November 2024 at 1:00am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Remove Schedule
Posted By: Rod001
Subject: Remove Schedule
Date Posted: 17 May 2007 at 7:13pm

Hi,

 

I am using VB6 and version 11.1.0.  I have created a small VB 6 app to test the code below. The code was created to remove a selected schedule in a multi-resource collection; somewhat like Outlook does to share calendar information. I am using a custom data provider.

                   

When I run code nothing seem to happen. I can't figure out how to make the code work or  if it’s even possible. 

 

Dim pSchedules As CalendarSchedules

Set pSchedules = CalendarControl.DataProvider.Schedules

If pSchedules Is Nothing Then

     Exit Sub

End If

       

Dim i As Integer

For i = 1 To pSchedules.Count

         pSchedules.RemoveSchedule (i)

Next i

       

CalendarControl.Populate

CalendarControl.RedrawControl

 
Thank you,
Rod



Replies:
Posted By: sserge
Date Posted: 19 May 2007 at 10:23am
Hi Rod,

Note that .Schedules collection just stores schedules information in the database. Also, collection is started from the Zero index, and index is changed after removal. So, if you'd like to delete all schedules, it should be done like this:

Dim i As Integer

For i = 1 To pSchedules.Count

         pSchedules.RemoveSchedule (0)

Next i


However, may be your actual goal is reconfigure resources collection? Then you need to work with another property: CalendarControl.MultipleResources

--
WBR,
Serge


Posted By: Rod001
Date Posted: 25 May 2007 at 7:07pm
Serge,
 
Thank you for the reply. You put me on the right track. I do beleive the following code is what I want to remove a selected resources from the calendar.
 
If CalendarControl.MultipleResources.Count > 1 Then
       CalendarControl.MultipleResources.Remove index
       CalendarControl.Populate
       CalendarControl.RedrawControl
End If
 
Thank you,
Rod



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net