Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SetFocus won't work in Valid?
Message
 
To
06/04/1999 03:36:36
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00205503
Message ID:
00205882
Views:
15
>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é
Previous
Reply
Map
View

Click here to load this message in the networking platform