Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to setfocus to control with BrokenRule
Message
 
 
To
28/11/2002 18:51:43
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00728050
Message ID:
00728076
Views:
20
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform