Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to ensure valid date in textbox??
Message
From
25/11/1998 13:42:50
 
 
To
24/11/1998 16:01:22
Paul De Niverville
Deniverville Econometric Research Ltd.
Victoria, British Columbia, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00161109
Message ID:
00161518
Views:
16
>Hi,
>
>This should be easy. I have a textbox with the control source a datetime field in a remote view. If I put in the incorrect date,(date ansi, century on) "1998.55.55", the entire textbox is selected but I can't leave the textbox.
>
>This is good, however I want to send a message to the user to saying that the month or day portion is incorrect. I tried putting code in the valid event, but the messagebox didn't show up.
>
>if not between(val(substr(dtoc(this.value),6,2)),1,12)
> = messagebox("Incorrect month. Re-enter date.",16)
> return .f.
>endif
>
>
>Any ideas.
>
>Thanks in advance.
>
>Paul

If that SET NOTIFY doesn't help, you could unbind the control. Then VFP doesn't know it's supposed to be a date and you can put your own error checking.

-Michelle
Previous
Reply
Map
View

Click here to load this message in the networking platform