Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SETFOCUS doesn't
Message
De
30/09/2004 16:07:49
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00947693
Message ID:
00947703
Vues:
17
Larry,

Sometimes the valid event will cause an error so I still use the lostfocus event.
CASE (CTOD(THIS.VALUE) > DATE())
	MESSAGEBOX("Error in Date: Greater than current date.",16)
     THIS.SetFocus
     nodefault 
endcase 
>Ok...I'm doing something stupid:
>
>I want to do some error checking on a date field in a form.
>In the "LostFocus event, I put the following code:
>
>
>DO CASE
>
>CASE (CTOD(THIS.VALUE) > DATE())
> MESSAGEBOX("Error in Date: Greater than current date.",16)
>THIS.SetFocus
>
>
>CASE(CTOD(THIS.VALUE) < DATE()-60)
> MESSAGEBOX("Error in Date: More than 60 days before today.")
>THIS.SetFocus
>
>ENDCASE
>

>
>When I run this, the cursor still goes to the next object one the form. Looking at the Event Tracking in the Debug Output, I show that the text box looses focus, the messagebox displays, the text box gets focus (presumably from my This.setfocus, and then immediately moves to the next object. So, why is this happening? -- L
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform