Print Page | Close Window

Setting Date programmatically in Access 2002

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


Topic: Setting Date programmatically in Access 2002
Posted By: Muesli
Subject: Setting Date programmatically in Access 2002
Date 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




Replies:
Posted By: Muesli
Date 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 ...



Posted By: SuperMario
Date 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



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