If you are just invested in the number, you can simplify things a bit:
var countA = 0;
for (var i=1;i<149;i++)
{
if (this.getField("AM."+i).value!="")
{
countAM++;
}
}
var countB = 0;
for (var i=1;i<149;i++)
{
if (this.getField("NEWFIELD."+i).value!="")
{
countB++;
}
}
event.value = countA - countB;
Karl Heinz Kremer
PDF Acrobatics Without a Net
PDF Software Development, Training and More...
http://www.khkonsulting.com