Framework EDI Reference. Methods and Properties
ediDataElement. RepeatCount

Returns the number of instances a data element has been repeated. This value is valid only for the first instance of the element, otherwise it returns zero.

Syntax:

Remarks

If this property is interrogated on the first instance of the repeating element, it returns the total count of all repeating instance -- including itself.  The first repeating instance always returns a RepeatNumber of one.

If this property is interrogated on any repeating instance other than the first, then it returns zero.  A repeating instance, that is not the first instance, returns a RepeatNumber greater than one.

Example:

Set oElement = oSegment.DataElement(1)
For i = 1 To oElement.RepeatCount
    Set oElementRepeat = oElement.GetRepeatInstance(i)
    txtTypeProduct(i).Text = oElementRepeat.Value
Next

Sample

P_RepeatCount.zip