>Hi all:
>
>I have aform which has an OLEControl (calendar)in it. I have also added three command button named This Year, This Month and This Week. I also plan to use buttons with directional arrows to enable the user to scroll through another year, another month another week or the previous year, month and week.
>
>Objective: Clicking any of the buttons should change the data, month and year displayed in the OleControl to:
>
>1. This Year = current date
>2. This month = current date
>3. This week = current date
>
>The following code did not work for me.
>
>
thisform.oleControl1.year.value = year()
>thisform.oleControl1.month.value = month()
>thisform.oleControl1.day.value = date()
>
>Am I on the right track? TIA.
>
>- Ravi
Ravi,
If it's datetimepicker control then there isn't 'value' property for year, day, month :
with thisform.oleControl1
.Month = 1
.day = 1
.year = year(date())
.month = month(date())
.day = day(date())
endwith
But there is a shorter way :
thisform.oleControl1.OBJECT.value = datetime()
Cetin