Results 1 to 11 of 11
  1. #1
    2 Star Lounger
    Join Date
    May 2005
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Calendar view (2007)

    I am using an active x calendar control in a scheduling form. It works fine except that when I am trying to schedule a new appointment the calendar will often open to a different month. I've tried to set a "default" month with both the onload and onopen events without success. The calendar will open properly but unfortunately it changes already scheduled appointments to the onload date. Can I leave the previously scheduled appointments alone (calendar opens to appropriate date) and open the calendar to the present month for new appointments (i.e. no appointments scheduled)?

    nebbia

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

    Re: Calendar view (2007)

    Is the calendar bound to a field in the record source of the table? If so, you shouldn't use code to set the date in the On Open or On Load event of the form, since it will modify the date value in an existing record.
    Instead, set the Default Value property of the date field in the underlying table to <code>=Date()</code>. This won't affect existing records, but it will fill in the current date as default value in new records.

  3. #3
    2 Star Lounger
    Join Date
    May 2005
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calendar view (2007)

    When the calendar is first opened it generally opens to a January view. Having changed the default of the underlying table to "=date()" it will jump to this date as soon as the calendar control is accessed. This is a big improvement. Can we take it one step further and have the calendar open to todays date for new (unscheduled) appointments

    nebbia

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

    Re: Calendar view (2007)

    Is the calendar control bound to a field in the record source of the form or isn't it?

  5. #5
    2 Star Lounger
    Join Date
    May 2005
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calendar view (2007)

    Sorry yes it is a bound control

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

    Re: Calendar view (2007)

    In that case, the calendar should display the value of the date field for existing records, and the default value for new records.

  7. #7
    2 Star Lounger
    Join Date
    May 2005
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calendar view (2007)

    And it does. Maybe I should be clearer. If one opens the calendar to a 'virgin' new record the default month and day are displayed. However, if a record is accessed for which no prior appointment was made, bound control is null, then the calendar opens to a aJanuary view.

    I am happy with the way its working now, but it would be nice if for all records without appointments, the calendar opened to todays date.

    Thank you for your help

    nebbia

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

    Re: Calendar view (2007)

    I don't think that's desirable. If you set the calendar to a date (such as today's date), you are actually changing the value of the date field. Surely it's not your intention to change the appointment date to today for all records in which the date hasn't been set yet!

  9. #9
    2 Star Lounger
    Join Date
    May 2005
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calendar view (2007)

    No I wouldn't want to change the appointment date field. What I am asking is this. When there is NO appointment scheduled and the calendar control is opened can the calendar VIEW open to the present month. What is happening now is that the calendar defaults to a January view. Once I click the calendar it immediately goes to the table default date as you had suggested. Is it possible to avoid that last click and have the view that is initially displayed be the present month.

    nebbia

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

    Re: Calendar view (2007)

    I'm sorry, I don't know how to do that with a bound control. Changing the year or month of the calendar changes the field its bound to.
    The only workaround I can think of is to make the calendar unbound (clear its Control Source), and to set the Date field in the On Click event of the calendar. But then, the user has to click on the calendar to set the date...

  11. #11
    2 Star Lounger
    Join Date
    May 2005
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calendar view (2007)

    Thanks. As I said is much better now. I may play with the onclick approach

    nebbia

Posting Permissions

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