Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting Control Source programmatically
Message
From
09/10/2002 12:52:34
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00709192
Message ID:
00709369
Views:
22
>Hi
>I am setting control source for a grid row as follows:
>Thisform.MyGrid.Mycolumn.ControlSource = Myfile.Balance
>
>This works fine.
>
>But If I want to show a description as in:
>Thisform.MyGrid.Mycolumn.ControlSource = Iif(Seek(Myfile.Code,'KMA'),Kma.Description,' ')
>
>I get a --> Data source for this object must be a variable reference.
>
>
>Anybody know if I can put an indirect refrence into conmtrol source programatically.

Did you copy the exact code? Thenn you need to enclose the control source in quotes (the property takes a string).
Thisform.MyGrid.Mycolumn.ControlSource = Iif(Seek(Myfile.Code,'KMA'),"Kma.Description",' ')
By the way, you know that this isn't dynamic, correct? It only fire when the control is initialized. If you need the controlsource to be dynamic, I'd suggest using two textboxes in the grid, and set the CurrentControl.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform