Microsoft KB Archive/209057

= MOD2000: Calendar Control Cannot Format Individual Dates =

Article ID: 209057

Article Last Modified on 6/24/2004

-

APPLIES TO


 * Microsoft Office 2000 Developer Edition
 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q209057



Moderate: Requires basic macro, coding, and interoperability skills.



SYMPTOMS
In the Calendar control included with Microsoft Access 2000 and Microsoft Office 2000 Developer, you can change the formatting of all the text, but you cannot change the formatting of individual dates.



CAUSE
This is a design limitation of the Calendar control.



RESOLUTION
A workaround for this behavior is to use a text box on your form that reflects the date selected in the Calendar control. The following example demonstrates how to create such a text box:  Open a form in Design view. On the Insert menu, click ActiveX Control, click Calendar Control 9.0, and then click OK. Change the Name property of the Calendar control to Calendar1. Add a new text box to the form. Change the Name property of the text box to CalendarDate.  Right-click the Calendar control and then click Build Event. Paste the following code: Sub Calendar1_Click

' This procedure sets the value of the CalendarDate text box to the value ' of the date selected in the Calendar control, with a Long Date format. ' Note that you can use the format of your choice--you do not have to use ' the Long Date format.

Me!CalendarDate.Value = Format(Me!Calendar1.Object.Value, "dddddd")

End Sub  Close the module.</li> View the form in Form view, and select different dates.</li></ol>

Additional query words: prb

Keywords: kbprb KB209057

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.