Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
KeyPreview and Valid, can anybody help me in this.
Message
From
29/03/1999 21:44:28
 
 
To
27/03/1999 10:56:12
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00202720
Message ID:
00203267
Views:
21
Since control never really leaves the control when Ctrl+S is pressed, the valid event will not fire first.

I recommend setting up a form-level validation method that is called when a save is requested. The validation routine will check all fields, possibly based on a property in the hosting control(s). If a field is invalid, focus is set to the control and the Save is denied.

Another advantage of this is that users can freely move through all fields for heads-down processing before having to stop to correct some data. You can still have individual controls call the validation method, if desired.

If this approach does not work for you, try executing the control's valid event as follows:

thisform.activecontrol.valid()

Hope this helps.

Greg Willcockson
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform