Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to setfocus to control with BrokenRule
Message
 
 
À
28/11/2002 18:51:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00728050
Message ID:
00728076
Vues:
21
>Hi all,
>
>What's the best way to setfocus to the control in a form (maybe with a pageframe to), that my COM object Bussiness Rules return's an error in it validate_data method, the return value from this method is the field name in 'lcerrofieldname'.
>
>Thank's in advance,
>
>João Batista

Two ideas came to mind:

1) If you always name your controls as txt+FieldName, you may try
if type('thisform.txt'+m.lcErrorFieldName)="O" && Object exists
    loObject = evaluate('thisform.txt'+m.lcErrorFieldName)
    loObject.SetFocus()
endif
2) Otherwise you have to loop through form's controls until you find controlsource equals to the error field.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform