Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to ensure valid date in textbox??
Message
 
 
À
24/11/1998 16:01:22
Paul De Niverville
Deniverville Econometric Research Ltd.
Victoria, Colombie Britannique, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00161109
Message ID:
00161518
Vues:
17
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform