Need help with array

hi all…I need help with an array, I have an array IncPPt and it contains a list of doc ID, I need to add a new doc ID to it…

I tried this but I get a SubScript out of range.


NumInListe = Ubound(listUNIDPPT) + 1

Redim Preserve listUNIDQP( NumInListe -1 ) As String

listUNIDPPT( NumInListe ) =  dConfr.PPTUNID `I am getting the error here..

										

dQP.QPListeUNIDPPT = listUNIDPPT

Call dQP.Save( True, False )



thanks

A.

Subject: Need help with array…

why are you subtracting from NumInListe?

Increase your NumInListe as you are doing with

Dim NumInListe as integer

NumInListe = Ubound(listUNIDPPT) + 1

then

Redim Preserver ListUnIDOP(NumInListe) as String

ListUNIDOP(ubound) = listUNIDPPT

didn’t test it - but that SHOULD work