Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting Control Source programmatically
Message
From
09/10/2002 14:45:34
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00709192
Message ID:
00709449
Views:
16
Gerard-

>I am setting these controls form a Parameter file and on a button on the screen (in my Base Class) I run a few lines of code as follows:
>
>lcCol = Alltrim(laGrid[lnFor,1]) && Array holds the column
>lcVar = ALLTRIM(laGrid[lnFor,2]) && Array line holds variable
>lcComm = lcCol + '.ControlSource=' + 'lcVar'
>&lcComm
>
>
>Now if lcVar has a simple field in it, it works fine
>But I've tried to get the IIF command working without success..
>If I enclose it in quotes, I just get a string out.

That's different from what you originally described. Let's suppose the following:
lcVar  = 'IIF(THISFORM.OptionGroup1.VALUE = 1, "thisform.text1value" , "thisform.text2Value")'
lcComm = 'this.ControlSource=' + lcVar
&lcComm
Previous
Reply
Map
View

Click here to load this message in the networking platform