FYI - The syntax you are unfamiliar with is a bit tricky at first. The resolveNode function evaluates a string and tries to see if there is a form object to match it. When your string is...
The script is looking for a Row with an index of "x", which technically does not exist. By breaking the string and concatenating in the variable (at runtime, whatever value that variable contains - in your case, the loop increment) to that string. LiveCycle will evaluate it as such.
No obvious syntax error in your code (although it's not the easiest to find always). But why do you put the ; after the closing bracket } ?
Your problem then. You should have multiple instances of the subform detail1 according to your code. Do you? And when does it generate the error, at i=1 or later on? Looks like a classic index error, your subform might very well be outside the index... or the button is missing that it's referring to?
I see that you have a count of the instances, but can you verify that the count is correct?
management has removed the button that this script was on... bullet dodged for now. Thanks for your help.
Sounds like you're on the right debugging track. I figured I was probably OK initiallizing the variable to 0 and then having the test at <= as I cant imagine that there would ever be negative instances of a subform?