Jean,
I'm lost there. Anyway what you think is OK than you could use "tag" property instead of creating a new property for all controls.
oControl.Controlsource = iif(type(oControl.tag) # "U",oControl.Tag,"")
Of course I assumed in "tag" you'd only keep things that you could write in controlsource.
Cetin
>Yes this can work, But I am looking for a way to revent retype all control source. Plus the MyAlias is not existing sometime.
>
>So my solution is to add to all control a custome property "MyCtrlSource" and set the controlsource in the init() of the container object.
>
>>
Jean,
>>If you change the alias in init then it should be available (if you're setting it to IsAlias.MyField then IsAlias must be available). Before init form.load or form.de would open it. If you have situation where availability is postponed then create a method that would do it. Method :
>>-Checks availablity of alias.
>>-If exists loops through controls and sets controlsource to :
>>stuff(Controlsource,1,at(".",Controlsource)-1,"NewAlias")
>>(You might want to check if controlsource is in MyTable.MyField format)
>>-Refreshes control
>>
>>Or alternatively if you're using DE :
>>-In DE change cursorsource and database of the cursor using "myAlias"
>>Cetin