Undoing user update of a field

Undoing user update of a field

I have two bits of code that are used for different subforms on the same form. The idea behind the code is to prevent the user from changing a field on a locked row (invoiced). The first code snippet works fine, the second gives an error.  Does anyone know why that would be?

  1. if(row.Locked)
  2. {
  3. cd = PrintCustomisations[ID == row.ID];
  4. if(cd.Height1 != row.Height1)
  5. {
  6. row.Height1=cd.Height1;
  7. }
  8. return;
  9. }
vs
  1. if(row.Invoiced)
  2. {
  3. info row.ID;
  4. pp = PrintPublication[ID == Row.ID];
  5. if(pp.Classification != row.Classification)
  6. {
  7. row.Classification=pp.Classification;
  8. }
  9. return;
  10. }
Error