Print Page | Close Window

Basic Unbound Useage

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=6722
Printed Date: 06 October 2024 at 12:50pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Basic Unbound Useage
Posted By: Carl Jensen
Subject: Basic Unbound Useage
Date Posted: 23 March 2007 at 5:11pm
Hello,

I'm just getting started using the Calendar control in Microsoft Access in unbound mode.  At this point I'm simply trying to add an Event to the calendar and display it on the screen.  I've added both the Calendar and DatePicker controls on a form and placed the following code in the Form_Load event:

--------------------------------------

Me.CalendarControl1.SetDataProvider "Provider=custom"
Me.CalendarControl1.DataProvider.Create
Me.CalendarControl1.DataProvider.Open  
Me.DatePicker2.AttachToCalendar Me.CalendarControl1.Object  
Me.CalendarControl1.ViewType = xtpCalendarMonthView
Me.CalendarControl1.DayView.ScrollToWorkDayBegin

''ADD AN EVENT TO CALENDAR
Dim NewEvent As CalendarEvent
Set NewEvent = CalendarControl.DataProvider.CreateEvent  
NewEvent.Subject = "Test Subject"  
NewEvent.StartTime = "3/20/2007"  
NewEvent.EndTime = "3/20/2007"  
CalendarControl1.DataProvider.AddEvent NewEvent
Me.CalendarControl1.Populate
Me.CalendarControl1.RedrawControl

---------------------------------------

In Access, this code generates an 'Object Required Runtime Error 424' error at this line:

Set NewEvent = CalendarControl.DataProvider.CreateEvent

I'm guessing the DataProvider isn't setup right???  How exactly does it need to be setup to work in a completely unbound mode?  Any help or suggestions to get my head wrapped around this 'very deep' control is much appreciated.

Thanks!
Carl Jensen





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