Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
180
Unbound Column is calculated and editable
posted

When I start my form all records are marked as edited (little pencil icon on the left).  When I comment out the code in my AfterCellUpdate event this doesn't happen.

I have an unbound column that contains value based on a bound column.

During

InitializeRow 

e.row.cells("UnboundCol").value = e.row.cells("BoundCol").value * 1.1

... and during

AfterCellUpdate

if e.cell.column.key = "UnboundCol" then

   e.cell.row.cells("BoundCol").value = e.cell.row.cells("UnboundCol").value / 1.1

end if

 

Am I doing it wrong?

Parents
  • 469350
    Offline posted

    Hi,

    Hm, this code is a bit unusual. So the Unbound column is 1.1 times the Bound column and the bound column is the unbound column divided by 1.1? That's going to create a sort've circular reference here. Why keep both values calculated continuously?

    Using AfterCellUpdate to update the value of a cell is usually not a good idea, since this will cause the event to fire again. In your case, it seems okay, since you are only checking for one particular column. So the second time the event fires, nothing happens.

    If you just want to get rid of the pencil, then what you need to do is commit the changes to the row. You do that by calling Update on the row after setting the cell value.

Reply Children