Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - Setting Date programmatically in Access 2002
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Setting Date programmatically in Access 2002

 Post Reply Post Reply
Author
Message
Muesli View Drop Down
Newbie
Newbie


Joined: 01 December 2008
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote Muesli Quote  Post ReplyReply Direct Link To This Post Topic: Setting Date programmatically in Access 2002
    Posted: 02 December 2008 at 11:02am
Hi,

Again testing Calendar 12.0.2 in Access 2002. I stumble upon the most basic functionality: Positioning programmatically the calendar control to a given date, whatever the view (day,month,week,...) and scroll to 8:00 AM. I tried the following code in the Form_Open method of a form, but the calendar stubbornly shows the current day/week or month and positions itself on Today at 0:00 AM.


    With Me.Calendrier
            .VisualTheme = xtpCalendarThemeOffice2003
            With .Options
                .WorkDayStartTime = TimeSerial(8, 0, 0)
                .WorkDayEndTime = TimeSerial(20, 0, 0)
                .UseOutlookFontGlyphs = False
            End With
            Select Case DisplayMode
                Case 5
                    .ViewType = xtpCalendarWorkWeekView
                    .WeekView.ShowDay Min(DateAdd("d", -2, LastWeekDayDate(GivenDate)), GivenDate), True
                Case 7
                    .ViewType = xtpCalendarWeekView
                    .WeekView.ShowDay GivenDate, True
                Case 31
                    .ViewType = xtpCalendarMonthView
                    .MonthView.ShowDay GivenDate, True
                Case Else
                    .ViewType = xtpCalendarDayView
                    .DayView.ShowDay GivenDate, True
            End Select
            .DayView.ScrollToWorkDayBegin
            .SetDataProvider "Provider=Access;"
            .DataProvider.OpenEx CurrentProject.Connection
            .Populate
            .RedrawControl
        End With

Back to Top
Muesli View Drop Down
Newbie
Newbie


Joined: 01 December 2008
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote Muesli Quote  Post ReplyReply Direct Link To This Post Posted: 03 December 2008 at 12:11pm
Sorry, but there's no fun using CalendarPro2008 in MS Access 2002. After I switched from the test version12.0.2 to 12.1.1 no improvements have occured.

What's more, :

1) the Populate method doesn't work either anymore (!!), meaning the Events are well read through the dataprovider, but none is displayed.

2) In place create event is disabled.

I give up ...

Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 10 December 2008 at 12:49pm
I am using 12.1.1 and everything seems to work fine.  I just modified the Calendar Access sample with this code:

Private Sub cmdDayView_Click()
    Me.CalendarControl1.ViewType = xtpCalendarDayView
    Me.CalendarControl1.DayView.ShowDay #1/20/2007#
End Sub

Private Sub cmdMonthView_Click()
    Me.CalendarControl1.ViewType = xtpCalendarMonthView
    Me.CalendarControl1.MonthView.ShowDay #1/20/2007#
End Sub

Private Sub cmdWeekView_Click()
    Me.CalendarControl1.ViewType = xtpCalendarWeekView
    Me.CalendarControl1.WeekView.ShowDay #1/20/2007#
End Sub

Private Sub cmdWorkWeekView_Click()
    Me.CalendarControl1.ViewType = xtpCalendarWorkWeekView
    Me.CalendarControl1.DayView.ShowDays #1/20/2007#, #1/24/2007#
End Sub
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.188 seconds.