Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    MSCAL.Calendar.7 (Access03)

    I have a MSCAL.Calendar.7 calendar control on my database. When the form comes up is continues to use the Month that the control was placed on the form. How do I make the control Month read the current month?

    Thank you. Fay

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: MSCAL.Calendar.7 (Access03)

    You can use a line of VBA code in the On Load event of the form to set the date when the form is opened. This assumes that the calendar control is not bound to a field in the record source of the form.

    Private Sub Form_Load()
    Me.Calendar0 = Date
    End Sub

    where Calendar0 is the name of the calendar control.

  3. #3
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MSCAL.Calendar.7 (Access03)

    How do I then get the value from the calendar. I am using Me.txtDateOfClassStart.Value = calDate in the On Exit event of the calendar control.

    But that doesn't carry the value over to the text box. calDate is the name of the calendar control.

    Thank you Fay

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: MSCAL.Calendar.7 (Access03)

    You can use the After Update event of the calendar control. This is not listed in the Event tab of the Properties window, but you can select it from the Procedure dropdown list in the module window (if the insertion point is in another event procedure for the calendar), or just type it in yourself:

    Private Sub calDate_AfterUpdate()
    Me.txtDateOfClassStart = Me.calDate
    End Sub

  5. #5
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MSCAL.Calendar.7 (Access03)

    Sorry I had placed the code in the wrong event. It is working now. Thanks. Fay

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •