locked
Calendar new month change event RRS feed

  • Question

  • Hi using Access 2003 calendar activeX. I would like to use the selected month when a user makes a change to the month using the calendar. However when stepping into the new month event the value is 0.

    Any ideas of the event for an unbound calendar control the allows me to retreive the month value after a user has selected a new month (focus is still on this control)?

    Many thanks,


    Jonathan
    Sunday, February 13, 2011 11:08 PM

Answers

  • Jonathan,
     
        You are referring to calendar control in Access 2003.
     
        Change of year or month can normally be trapped via NewYear and NewMonth events of calendar control. However, it is observed that when year or month values in calendar control are changed, it lapses into a state of virtual hibernation. In this situation, no meaningful values are returned for Year, Month, Day or Value properties of the control. Year, Month and Day properties return zero, whereas Value property (meant to show selected date) returns Null.
     
        The remedy happens to be interesting. It involves something akin to imparting a jolt -by setting the calendar control to a dummy date outside the permissible range (e.g.#1/1/1000#). This forces the calendar control to come out of hibernation, without actually passing the dummy date to its value property. As a result, the calendar control now returns all values correctly (i.e. year, month and date).
     
        In this context, my sample db named Form_MSCalGetDtByYrMnChange might be of interest to you. It is in access 2000 file format and is available at Rogers Access Library. Link:
     
        This sample db demonstrates a way to make the Calendar Control respond directly to change of month or year by the user. Two styles are covered as follows:

        (a) Hyper Mode - Date returned by calendar control responds directly to month / year change by user.
        (b) Normal Mode - New month/year selection has to be followed by clicking day of month so as to get appropriate date.

        The user can select either of the above styles via an option group adjacent to the calendar control.

    Best wishes,
    A.D. Tejpal
    ------------
     
    ----- Original Message -----
    Newsgroups: Msdn.en-US.accessdev
    Sent: Monday, February 14, 2011 4:38 AM
    Subject: Calendar new month change event

    Hi using Access 2003 calendar activeX. I would like to use the selected month when a user makes a change to the month using the calendar. However when stepping into the new month event the value is 0.

    Any ideas of the event for an unbound calendar control the allows me to retreive the month value after a user has selected a new month (focus is still on this control)?

    Many thanks,


    Jonathan

    A.D. Tejpal
    • Marked as answer by Kiwi Jonathan Monday, February 14, 2011 8:11 PM
    Monday, February 14, 2011 4:09 AM

All replies

  • Jonathan,
     
        You are referring to calendar control in Access 2003.
     
        Change of year or month can normally be trapped via NewYear and NewMonth events of calendar control. However, it is observed that when year or month values in calendar control are changed, it lapses into a state of virtual hibernation. In this situation, no meaningful values are returned for Year, Month, Day or Value properties of the control. Year, Month and Day properties return zero, whereas Value property (meant to show selected date) returns Null.
     
        The remedy happens to be interesting. It involves something akin to imparting a jolt -by setting the calendar control to a dummy date outside the permissible range (e.g.#1/1/1000#). This forces the calendar control to come out of hibernation, without actually passing the dummy date to its value property. As a result, the calendar control now returns all values correctly (i.e. year, month and date).
     
        In this context, my sample db named Form_MSCalGetDtByYrMnChange might be of interest to you. It is in access 2000 file format and is available at Rogers Access Library. Link:
     
        This sample db demonstrates a way to make the Calendar Control respond directly to change of month or year by the user. Two styles are covered as follows:

        (a) Hyper Mode - Date returned by calendar control responds directly to month / year change by user.
        (b) Normal Mode - New month/year selection has to be followed by clicking day of month so as to get appropriate date.

        The user can select either of the above styles via an option group adjacent to the calendar control.

    Best wishes,
    A.D. Tejpal
    ------------
     
    ----- Original Message -----
    Newsgroups: Msdn.en-US.accessdev
    Sent: Monday, February 14, 2011 4:38 AM
    Subject: Calendar new month change event

    Hi using Access 2003 calendar activeX. I would like to use the selected month when a user makes a change to the month using the calendar. However when stepping into the new month event the value is 0.

    Any ideas of the event for an unbound calendar control the allows me to retreive the month value after a user has selected a new month (focus is still on this control)?

    Many thanks,


    Jonathan

    A.D. Tejpal
    • Marked as answer by Kiwi Jonathan Monday, February 14, 2011 8:11 PM
    Monday, February 14, 2011 4:09 AM
  • Awesome A.D. Tejpal ! Such a simple solution does not do justice to the obvious time and thought that went into researching the calendar object, and into setting up the demonstration application.

    Many thanks,

    Jonathan


    Jonathan
    Monday, February 14, 2011 8:14 PM