Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - Remove Schedule
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Remove Schedule

 Post Reply Post Reply
Author
Message
Rod001 View Drop Down
Newbie
Newbie


Joined: 29 September 2006
Location: United States
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote Rod001 Quote  Post ReplyReply Direct Link To This Post Topic: Remove Schedule
    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
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Rod001 View Drop Down
Newbie
Newbie


Joined: 29 September 2006
Location: United States
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote Rod001 Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.