![]() |
Remove Schedule |
Post Reply ![]() |
Author | |
Rod001 ![]() Newbie ![]() Joined: 29 September 2006 Location: United States Status: Offline Points: 25 |
![]() ![]() ![]() ![]() ![]() 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
|
|
![]() |
|
sserge ![]() Moderator Group ![]() Joined: 01 December 2004 Status: Offline Points: 1297 |
![]() ![]() ![]() ![]() ![]() |
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:
However, may be your actual goal is reconfigure resources collection? Then you need to work with another property: CalendarControl.MultipleResources -- WBR, Serge |
|
![]() |
|
Rod001 ![]() Newbie ![]() Joined: 29 September 2006 Location: United States Status: Offline Points: 25 |
![]() ![]() ![]() ![]() ![]() |
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
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |