Most likely your itemSetup_StockInventAvg
variable is a real control, not a real.
Try using:
if (localStockInventAvg != itemSetup_StockInventAvg.realValue())
or better (because the control stores the result in itemSetup.StockInventAvg
):
if (localStockInventAvg != itemSetup.StockInventAvg)
Update: This makes no sense, since localStockInventAvg
was set to itemSetup.StockInventAvg
the line before.