Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Question about Calendar OCX
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00080502
Message ID:
00080517
Views:
22
>I have a form in which I am using the Calendar OCX supplied with VFP.
>
>On the form the user selects a billing start date and then a billing end date. I want the calendar to display the 'default' end date that is specified in this code in a command button:
>
>DO CASE
>
> CASE month(thisform.calendar.value) = 1
> thisform.calendar.value = thisform.startdate + 30
> ** the start date is stored in thisform.startdate>I have a form in which I am using the Calendar OCX supplied with VFP.
>
>On the form the user selects a billing start date and then a billing end date. I want the calendar to display the 'default' end date that is specified in this code in a command button:
>
>DO CASE
>
> CASE month(thisform.calendar.value) = 1
> thisform.calendar.value = thisform.startdate + 30
> ** the start date is stored in thisform.startdate
>
> CASE month(thisform.calendar.value) = 2
> thisform.calendar.value = thisform.startdate + 27
>
> CASE month(thisform.calendar.value) = 3
> thisform.calendar.value = thisform.startdate + 30
>
> .... and so on until December
>
> ENDCASE
> thisform.refresh()
>
>The calendar does not refresh to display the new 'default' value.
>
>Any ideas as to what I'm missing here? Or, is there an easier way to do this?
>
>thanks, AL

The calendar control has properties for month, day and year. Assuming the date you want to display is in "ldDate", refresh the calendar properites individually with something like this:

.oCalendar.month = month(ldDate)
.oCalendar.day = day(ldDate)
.oCalendar.year = year(ldDate)
.oCalendar.refresh()

Should work for you.

Rick
Rick Borup, MCSD

recursion (rE-kur'-shun) n.
  see recursion.
Previous
Reply
Map
View

Click here to load this message in the networking platform