Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21090

Need help on this specific code

$
0
0
Hi all,

I have the following code

Code:


If branch_ = "BBB" then
date_ = datemin
seq = datediff ("d" , #3/26/2013#, Now)
fileName = "D1000001" & "." & Format(seq, "000")


The above code creates a file name with D100001.XXX , where XXX will be determined by the difference in number of days from today's date from 3/26/2013. The code is executed when the user clicks on a button named "Upload". A file is generated and uploaded to a server.


How can i modify the code so that instead of using date difference to determine value for XXX, it starts off from 000 and automatically adds 1 to the value to a maximum of 999?


For e.g.

Today, file name is D100001.000
Tomorrow, file name is D100001.001
The day after, D100001.002, and so on


Appreciate your assistance!

Viewing all articles
Browse latest Browse all 21090

Trending Articles