![]() |
DatePicker ocx and Access |
Post Reply ![]() |
Author | |
StephenMurphy ![]() Newbie ![]() Joined: 13 July 2008 Location: Canada Status: Offline Points: 8 |
![]() ![]() ![]() ![]() ![]() 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. |
|
![]() |
|
StephenMurphy ![]() Newbie ![]() Joined: 13 July 2008 Location: Canada Status: Offline Points: 8 |
![]() ![]() ![]() ![]() ![]() |
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. |
|
![]() |
|
dr.iak ![]() Newbie ![]() Joined: 30 March 2008 Status: Offline Points: 1 |
![]() ![]() ![]() ![]() ![]() |
Hello, I also use the datepicker and the calendar control in an
Access 2003 project and the AttachToCalendar method works perfectly. Bernd |
|
![]() |
|
StephenMurphy ![]() Newbie ![]() Joined: 13 July 2008 Location: Canada Status: Offline Points: 8 |
![]() ![]() ![]() ![]() ![]() |
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. ![]() |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |