Print Page | Close Window

DatePicker ocx and Access

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=11425
Printed Date: 07 October 2024 at 7:28am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: DatePicker ocx and Access
Posted By: StephenMurphy
Subject: DatePicker ocx and Access
Date Posted: 13 July 2008 at 10:32pm
I am trying to use the Calendar demo ocx in Access 2003. The control registers ok and I am able to insert an instance of both the Calendar and the Date Picker onto the form and they both appear properly at runtime. However, the correct methods for the DatePicker seem to be missing, and I am only allowed to pick from general ole control properties. I can't access any of the DatePicker specific methods or properties such as AttachToCalendar. I just get the error "Class does not support Automation or does not support expected interface." 

Is there any way to rectify this? I have registered and unregistered the control several times, but it doesn't seem to help.

It works fine in VB6, but not Access. Any help appreciated.



Replies:
Posted By: StephenMurphy
Date Posted: 14 July 2008 at 11:25am
Just as a followup, I am still unable to get the AttachToCalendar method of the DatePicker control to become available in Access 2003. The datepicker and calendar controls do seem to function properly in the form otherwise.

Is there a way to transfer info from the datepicker to the calendar manually in a SelectionChanged event? The following seems to work:

Private Sub DatePicker1_SelectionChanged()
Dim dpSel As DatePickerSelection

    Set dpSel = DatePicker1.Selection
   
End Sub

Is there a way to tell the calendar to use that selection in its current view?

Any help appreciated.


Posted By: dr.iak
Date Posted: 16 July 2008 at 7:02am

Hello,

I also use the datepicker and the calendar control in an Access 2003 project and the AttachToCalendar method works perfectly.

Greetings

Bernd


Posted By: StephenMurphy
Date Posted: 16 July 2008 at 11:27am
Originally posted by dr.iak dr.iak wrote:


Hello,

I also use the datepicker and the calendar control in an Access 2003 project and the AttachToCalendar method works perfectly.

Greetings

Bernd


Isn't that odd? I have tried it on two machines here with Access 2000/2003 and 2007, and in all three environments, the DatePicker control is missing many methods that Intellisense does not pick up. Perhaps because there are two interfaces in the ocx and Access on my machines is ignoring the second. I unregistered and re-registered the control several times but that didn't help.

My solution was to make the call as follows:

Call DatePicker1.AttachToCalendar(Me.CalendarControl1.Object)
 
That did the trick and connected the two.



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