Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SetFocus won't work in Valid?
Message
 
À
06/04/1999 03:36:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00205503
Message ID:
00205882
Vues:
14
>I need to SetFocus back to the textbox after it losses it focus when it's empty. I try setting enable = .F. for all other controls but it's not very good idea for my task. However the SetFocus won't work in Valid, compared to Init.
>
>Thanks in advance.
>
>Gan

Gan,

You've received plenty of good advice on how to achieve a specific goal. Another approach would be to place all your validation rules in a hook, just before saving the record.

My Save() method goes like this:

IF BeforeSave()
the usual Save here
ENDIF

Then the BeforeSave()
IF !Rule for field 1
Find the offending control
put its back color in flamant red
set the focus to it
send a warning message
RETURN .F.
ENDIF

etc...

José
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform