There’s a bug currently logged against Acrobat 7.x where removing an instance of a dynamic subform, using the “Instance Manager”:http://blogs.adobe.com/formbuilder/2006/05/instantiating_subforms_at_runt.html (IM)’s _removeInstance(int)_ method, doesn’t cause an update to the IM’s _count_ of currently instantiated subforms.
OK, so maybe that was a little too technical so I’ll try to simplify: In Acrobat 7.x, when you remove an instance of a dynamic subform using the IM’s _removeInstance(int)_ method and then check the number of remaining instances using the _count_ property, the number you’ll get won’t reflect the number that remains.
Adobe is aware of this bug and will hopefully be providing a fix for it in an up-coming release.
Fortunately, there’s a simple work-around (and even if the bug gets fixed in a future release, you should probably be checking the version of Acrobat that’s running your form to determine whether you need to be using the work-around or not):
// Force a remerge of the form’s current data set with its template
// to cause an update to the “count” property of all IMs