>>Hi Tom,
>>
>>Look at AddObject () or NewObject () to add a new control in the form. The control you add should be a class that can read the validation rule and validate it at runtime.
>>
>>HTH
>>
>>>I have a form to which I want to programmatically add some objects, based on a configuration table. My table specifies information about the object, including an expression for validation.
>>>
>>>How can I add my object programmatically to the form and specify a validation rule for it?
>>>
>>>I'm sure this must be simple and I'm missing something obvious. I did it in FP2.6.
>
>----
>Merci, Sylvain,
>
>So I guess I need a special class of my textbox, for example, with a new property called, for example "ValidExp". Then, in my VALID method I would put:
>
return eval(this.ValidExp)
>
>Then I would add it to my form with:
>
>MyForm.AddObject("txt1", "SpecialTextboxClass")
>loTxt1 = MyForm.txt1
>loTxt1.ValidExp = lcValidationExpression
>
>
>Is that it?
>
>-- Tom
That should work. I would do it exactly the way you explain it.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)