Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Control source depends on the _screen.ActiveForm
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01547969
Message ID:
01548081
Views:
59
This message has been marked as a message which has helped to the initial question of the thread.
>Hi everybody,
>
>I have this code (not sure why it's referencing _screen.ActiveForm)
>
>
>lcObject=sys(1272, this.parent)
>		lcScreenObject = "_SCREEN.activeform." + justext(m.lcObject)
>		if type(m.lcScreenObject + '.name') = 'C'
>			lcCostSource = m.lcScreenObject + ".a_cost(&lcRecn,&lcColIndex)"
>
>			.cnt_PurchOrd.spn_Cost.controlsource = lcCostSource
>
>			lcRecvSource = lcScreenObject  + ".a_Recv(&lcRecn,&lcColIndex)"
>			.cnt_PurchOrd.spn_Received.controlsource = m.lcRecvSource
>
>			.cnt_PurchOrd.txt_OnHand.value = evaluate(lcScreenObject +".a_OnHand(&lcRecn,&lcColIndex)")
>			.cnt_PurchOrd.txt_lstCost.value = evaluate(lcScreenObject +".a_LastCost(&lcRecn,&lcColIndex)")
>			.cnt_PurchOrd.txt_OnOrder.value = evaluate(lcScreenObject +".a_OnOrd(&lcRecn,&lcColIndex)")
>		endif
>
>
>when the ActiveForm changes, it gives an error. Is there any way to make the above conditional in the ControlSource?
>
>Thanks in advance.

That is...weird.
If you need to update some properties in some form then pass it as parameter to the routine.
You can't relay on the current form (maybe only if you have SDI).
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform