Print Page | Close Window

How to Retrieve Schedule from Calendar Cl

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=7183
Printed Date: 26 November 2024 at 9:46pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to Retrieve Schedule from Calendar Cl
Posted By: jetlounge
Subject: How to Retrieve Schedule from Calendar Cl
Date Posted: 19 May 2007 at 9:30am

I am using the control in an Access form. Clicking the Calendar at a certain time I am able to retrieve all properties for that event (time/description, etc)

Is there a way to determine the Schedule that was clicked as well? I can't seem to find that property or sample code.




Replies:
Posted By: sserge
Date Posted: 19 May 2007 at 9:40am
Something like that:
?

    Dim HitTest As CalendarHitTestInfo
    Set HitTest = Me.CalendarControl1.ActiveView.HitTest

    HitTest.ViewGroup ' <-- This is a schedule group


--
WBR,
Serge


Posted By: jetlounge
Date Posted: 19 May 2007 at 10:46am
Thanks for the quick reply
 
That doesn't work for all situations, but i think it put me on the right track. Is it safe to assume the following:

1) Click an EXISTING event in the calendar use:
HitTest.ViewGroup
 .MutlipleResources and further properties will get me to the actual SheduleID / Name

2) Click for a NEW event from the calendar control use:
CalendarControl.ActiveView.Selection.GroupIndex
from there it looks like I need to cross-ref the array to determine the scheduleID and name  


Posted By: sserge
Date Posted: 19 May 2007 at 11:02am
Well, no need to complicate. Those are different things.
-- HitTest determines a last click.
-- CalendarControl.ActiveView.Selection determines a selection of cells on the control.

If you'd like to determine an event by click -- look like it is done in our sample application:

Private Sub CalendarControl_DblClick()
    Dim HitTest As CalendarHitTestInfo
    Set HitTest = CalendarControl.ActiveView.HitTest
   
    If Not HitTest.ViewEvent Is Nothing Then
        MsgBox HitTest.ViewEvent.Event.ScheduleID
    End If
End Sub



--
WBR,
Serge


Posted By: jetlounge
Date Posted: 19 May 2007 at 1:51pm
ok, i am missing something...because that will only provide a schedid when an event exists (not .viewevent is nothing).
 
But if i also click a cell and want to add a new event, and populate the add form with the schedid that was clicked, the valid of viewevent and viewgroup is nothing.
 
so i need a way to determine what the schedule is even though an event does not yet exist.



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