It also could be, that the Amount contains NULL... This may cause problems...
>An earlier reply suggested you check that your variables were in scope - presumably it is at grid.init that you set up the DynamicBackColor.
>
>In addition, check that the variables actually have numeric values (zero is OK) as the IIF tests compare them to numbers. If you haven't assigned a value to them, although they are in scope, (so that they are .F.) the comparison tests fail and you get this error message. As soon as the command is processed, it is applied, so an invalid value causes a problem.
>
>To avoid the scope problem, the tested variables should be properties of the form; you can initialise them to be zero when you design the form.
>
>Possibly you could try a messagebox immediately before you set the DynamicBackColor to show you the values of the variables you are using.
>
>HTH
>
>Mike
If it's not broken, fix it until it is.
My Blog