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
|