0

Hey guys,

Im having a little problem with adding textbox.Im generating unique key with OrderNumber+ProductId+Series.

OrderNumber:18501
ProductId:2100
SeriesNumber:01

Series starts at "01" and gets added one everytime I hit button1,so next time I press button1,it will be "02".When I add them up this is the result I get:
Result:18501-2100-1

But I want the result to be like this:
Result:18501-2100-01

I want the series number to be a two digit value.How can I make this happen?Do I look

5
Contributors
9
Replies
12
Views
5 Years
Discussion Span
Last Post by Unhnd_Exception
0

Try,

no=2
str=no.ToString("D2")

I dont understand.Sorry Im a newbie!!!

-2

Try this:

dim SeriesNumber_in as string
dim SeriesNumber_out as int
dim mi as int

SeriesNumber_in="Put SeriesNumber Here"
mi=SeriesNumber_in.lenght

if mi = 1 then
SeriesNumber_out = 0 + mi
End If

SeriesNumber_out should give you the answer, for example if you input a 2 it will give you a a 02 but if you input something like a 12 it will stay un-touched.

plz reply if this helped or if you need further assistance. :)

Comments
Worthless Garbage.
-1

Try this:

dim SeriesNumber_in as string
dim SeriesNumber_out as int
dim mi as int

SeriesNumber_in="Put SeriesNumber Here"
mi=SeriesNumber_in.lenght

if mi = 1 then
SeriesNumber_out = 0 + mi
End If

SeriesNumber_out should give you the answer, for example if you input a 2 it will give you a a 02 but if you input something like a 12 it will stay un-touched.

plz reply if this helped or if you need further assistance. :)

It doesnt do anything...

0

Try this:

seriesnum = seriesnum * 100 
dim seriestr as string = right(seriesnum.tostring,2)
0

Try this:

seriesnum = seriesnum * 100 
dim seriestr as string = right(seriesnum.tostring,2)

Cant seem to get Right Function to work!Gives me this error:
Public ReadOnly Property Right() As Integer' has no parameters and its return type cannot be indexed.

Anyone have other methods?

0

Got it figured out guy!!Thanx for the ideas

Used
If Len(Serie.ToString) = 1 Then
Serie = "0" + Serie
Else
Serie = Serie
End If

this did the work!!

0

Glad you got it figured out. You did in 5 lines of code what adatapost did in 1 line. Congratulations!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.