+ Function counting Zeros 0

nimedon
01-02-2008, 01:08 PM
Hello
how can I use de function + but with 3 digits counting zeros 0, I have this:

Label1.Caption = Label1.Caption + 1

but these doesn't count the 0 to the left, I want something that do this:

001
002
003
004
005
006
007
008
009
etc

until 999


can anyone help me?

thank you very much!

the master
01-02-2008, 01:34 PM
You need the format() function. You should also use val() because you are trying to numerically add to a string value.


Label1.Caption=format(val(Label1.Caption)+1,"000")

AstroTux
01-02-2008, 01:35 PM
Hi,

Label1.Caption = Format(Label1.Caption + 1, "000")

Best regards,
AstroTux.

nimedon
01-02-2008, 01:46 PM
thanks guys =D

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum