>>>>>>Does anyone have a sure solution to the VALIDATION OF A CONTROL OR CONTAINER?????
>>>>>>
>>>>>>
>>>>>>TIA,
>>>>>>Peter
>
[snip]
>
>I realize this doesn't let you attach your validation to the container,
>but the only way I can think of doing that would be to create a method
>that checks validation, and then call it frequently.
>
>Hope this helps...
>
>--Liz
I actually decided on an alternative approach. I decided to place code inside the When event of every control on the form (of course this could automatically be done with subclassing). The when event compares the old control (stored in thisform.ActiveControl) to the new control (stored in this) and then searches, starting with the old control, all the parents until a common parent to the old and new is found. For each search iteration a check is made for a ControlValid() method (using pemstatus) and if that method exists and returns false then the when returns false and the new control never gains focus.
There is still a minor loophole in that for the ThisForm.ActiveControl is not available in the QueryUnload event and so I cannot validate any of my containers when I quit the form. Oh well, guess you can't win it all......
Thanks for your help,
Peter
Peter Stephens
Visual Records, Inc.
Lead Programmer for the general purpose record keeping system Visual Records. Written primarily in VFP 6.0 with a little C++.