Sequential numbering failing when reading alphanumeric values

Subject: Sequential numbering failing when reading alphanumeric values

Subject: Sequential numbering failing when reading alphanumeric values

Hi,

Once you get the value of GlobalID…split the value by means of Alphabets and Numbers…then you increment the number and again join them…here the issue is how do you segrigate the number…and this problm can be avoided if you can maintaine the standard format for uniqueid…

Regards,

Venkat.

Subject: RE: Sequential numbering failing when reading alphanumeric values

Subject: RE: Sequential numbering failing when reading alphanumeric values

will the value in the GlobalID field always be the same format of “aaaaannnn” - 5 alphas and 4 numerics? If so you can create some logic to get the 4 rightmost chars, increment the number then join it back.

Subject: RE: Sequential numbering failing when reading alphanumeric values

x="TC2RN001"y= Left(x,5)

z=Right(x,3)

Msgbox y+z

try somthing in this way…

Regards,

Venkat

Subject: RE: Sequential numbering failing when reading alphanumeric values

Subject: RE: Sequential numbering failing when reading alphanumeric values

Hi,

Use:

var1=doc.GetItemValue(“GlobalID”)(0)

Konrad

Subject: RE: Sequential numbering failing when reading alphanumeric values

Hi Konrad,

That seems to have worked to a point. The code now runs to Msgbox “3.00” and fails when trying to process:

docnum = var2+var3

This may be because var2 = “TC2RN” and var3 = “0045”

Any suggestions?

Subject: RE: Sequential numbering failing when reading alphanumeric values

Hi,

You are getting “Type mismatch” error becuase var2 is variant string type and var3 variant number type.

Something like that should solve your problem:

docnum = var2 + Right(“000” + Cstr(var3), 4)

Konrad

Subject: RE: Sequential numbering failing when reading alphanumeric values

Hi Konrad,

That works perfectly.

Thank you.