Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP3.0b: Editing Date Fields
Message
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00016490
Message ID:
00016604
Views:
66
>>We have date fields on our forms and when an invalid date is entered by the user, FoxPro displays it's default error 'Invalid date'.
>>
>>Note that we are not working with the date in character format. It is in a date format versus a character format.
>>
>>We tried using the Error event but find that VFP's default date edit kicks in first.
>>
>>We would like to display our own message instead of VFP's message. Anybody have any solutions?
>>
>>Thanks,
>>
>>Mario
>
>Return 0 (the number zero) in the VALID method. Also, SET NOTIFY OFF.
>
>Craig


If you want more functionality than the VFP 'is this an actual date', such as wanting to provide code for weekdays vs weekends, use a regular text field formatted like a date field. In the valid, put

if ctod(this.value) = { / / } && not a valid date
*** Your message here
return 0
else
if this.value .... specialized code
return 0
endif
endif

Barbara Paltiel
Barbara Paltiel, Paltiel Inc.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform