To write the conditional code, override a method in the frame that contains both controls. Choose a method that the Factory calls any time after the data values are available, such as the frame's OnRow( ) method or, for accessing an aggregate control, the frame's Finish( ) method.
"How To"
1. Assign a value to the ObjectVariable property of the control. i.e. assign SalesPrice to PriceCurrencyControl.
Do not use the name of a existing method or control when you assign a value to ObjectVariable. If done an error occurs when report compiles.
2. Assign a value to the ObjectVariable property of the second control. i.e. assign LuxuryFlag to CodeLabel Control.
3. Override the OnRow() method of the containing frame to write the Conditional code:
Sub OnRow(row As AcDataRow)
Super::OnRow(row)
If SalesPrice.DataValue > 35000 Then
LuxuryFlag.Text = "Luxury"
LuxuryFlag.Font.Color=Red
End If
End Sub
Using ObjectVariable, you can access a control only from its cotaining frame, not from another control.
Hope this helps,
AbbyNL