Your code will need to be changed. I’ll give the changes first, then explain why these changes are needed.
The best solution would be to split the code into two separate sections. The first line, NET=...
is ok in the code for the field. Everything else should be in a separate procedure, triggered by a menu or button (easiest would be to put this in the Action menu). Once you’ve entered the last column, you would need to manually choose this item from the Action menu.
If you really want all this to trigger from the tab key, I think adding a wait 0
after the first line will allow it to work, like this:
NET=zeroblank(«TOTAL GROSS » - (FICA + FICH + «FED W/H»))
wait 0
Field "REG GROSS "
total
...
(As an aside, why do the field names REG GROSS and TOTAL GROSS have a space at the end? That seems like a recipe for confusion and mistakes.)
I’m sure you are wondering why these changes are needed now and weren’t needed before. Well, actually, they were always needed, but you got lucky.
When a procedure is triggered by the tab key, Panorama is in a special internal mode. Usually when a procedure runs, it has the full attention of Panorama and can do anything. But in this case, Panorama is in the middle of performing the tab operation – when the procedure is finished, it will automatically start editing the next data cell according to the tab order. If your procedure does something like switch to another field, switch to another window or make calculations beyond the current record, that will mess up the pending tab operation. Your code is doing two things that aren’t allowed in this type of procedure:
- using the Field statement
- calculations beyond the current record (the total statement)
In the past you could sometimes get away with these bad practices, as you have. But recently a bug was discovered that could cause valid code triggered by data entry to incorrectly store the results of calculations in the code. Of course this was a very serious problem. The fix for this serious problem required Panorama to be more strict with code that is triggered by data entry.
As I mentioned, I think the best solution is to split your code so that the field and total statements are run in their own separate procedure, triggered by a menu item. I think the wait 0 solution will also work, but will probably behave weirdly if you press the tab key. It should be ok when pressing the Return or Enter key though.