Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - Get working: Calendar with customized Datasource
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Get working: Calendar with customized Datasource

 Post Reply Post Reply
Author
Message Reverse Sort Order
el austriaco View Drop Down
Newbie
Newbie


Joined: 02 March 2013
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote el austriaco Quote  Post ReplyReply Direct Link To This Post Topic: Get working: Calendar with customized Datasource
    Posted: 02 March 2013 at 3:33am
Hi guys,

I want to use the calendar-control with a customized datasource within Microsoft Access, but despite going through the samples provided (vb, vb.net and access) I couldn''t set it up. I could not find an easy accessible step-by-step guide to what I need. In the following you see how I imagine this to work (from what I have seen in the examples):

In Form_Load the calendar-objects (calender itself and date-picker) are loaded and attached to each other.
Private Sub Form_Load()

      'Load Calendar
      Set m_Calendar = Me.ocxCalendar.Object
      m_Calendar.SetDataProvider "Provider=Custom;"
      m_Calendar.DataProvider.Create

      'Attach Date-Picker to calendar
      Set m_DatePicker = Me.ocxDatePicker.Object
      m_DatePicker.AttachToCalendar m_Calendar

End Sub


As there is no data-source assigned to the calendar I would expect the DoRetrieveDayEvents to be fired by the calendar-object in order to retrieve the events (=Load them to the Events-parameter) for the date-range currently on display. What actually happens is that the event is fired a few thousand times (for each day until year 2020+), seemingly without a reason.  
Private Sub m_Calendar_DoRetrieveDayEvents(ByVal dtDay As Date, ByVal Events As XtremeCalendarControl.CalendarEvents)
   
   m_RdeCounter = m_RdeCounter + 1
   Debug.Print "EVT: m_Calendar_DoRetrieveDayEvents " & dtDay & ", event-occurence " & m_RdeCounter
  
End Sub


What I achieved so far is to load some events to the calendar-control. (But this is not exactly what I want as the user chooses the dates he wants to see within the calendar-controls.)
Private Sub cmdTest_Click()

   Dim c As Calendar 'This is my custom-calendar-object
   Dim i As Calendar_Item
   Dim j As XtremeCalendarControl.CalendarEvent

   'Clear existing events
   m_Calendar.DataProvider.ClearCache

   'Load calendar
   Set c = Cal_Data_Load
  
   'Transfer calendar-items to code-jock-calendar
   For Each i In c.Items
      Set j = m_Calendar.DataProvider.CreateEvent
      Me_Event_HereToJock i, j
      m_Calendar.DataProvider.AddEvent j
   Next

   m_Calendar.DataProvider.Save

   'Redraw contol
   m_Calendar.Populate

End Sub


This actually transfers the properties of 'my' calendar-item to the codejock one. The Id-thing I couldn't figure out either, although I obviously need to re-fetch it when later saving the element in the database.
Private Sub Me_Event_HereToJock(Here As Calendar_Item, ByRef Jock As XtremeCalendarControl.CalendarEvent)

   With Jock
      '.Id = Here.Id
      .StartTime = Here.Date_Start
      .EndTime = Here.Date_End
      .Subject = Here.Text
      .Location = Nz(Here.AdrId, "")
   End With

End Sub


So any chance to get help on this? I would just need a working example for a customized database as described for Ms Access or Vb.net. As I mentioned in the previous post I've already contacted codejock-support without reaction. So I am writing here in order to benefit from public knowledge. Smile

The database containing the above code can be downloaded here:
http://www.zaunsystem.net/cal.zip

Thanks for any reponse!

Georg
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.139 seconds.