1,105,406 Community Members

Auto Generate Number

gpriya govind
Newbie Poster
1 post since Feb 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
Unverified Member
 
0
 

Generate the auto generate number with current month and year. Its Should auto generate. Thanks in advance

Member Avatar
hometownnerd
Junior Poster in Training
50 posts since Sep 2007
Reputation Points: 13 [?]
Q&As Helped to Solve: 6 [?]
Skill Endorsements: 4 [?]
 
0
 

Not sure what you are looking for exactly but maybe this will help you.

Dim RandomClass As New Random()
Dim RandomNumber As Integer
Dim strStringPart As String = Month(Now).ToString & Year(Now).ToString
Dim NewRandomNumber As Integer
RandomNumber = RandomClass.Next(1000, 9999)
NewRandomNumber = Int32.Parse(strStringPart & RandomNumber)
'NewRandomNumber contains 220135765 which is month, 4 digit year, and random number between 1000 and 9999

hope that helps or gets you in the right direction.
Larry

Member Avatar
JorgeM
IT Addict
6,419 posts since Dec 2011
Reputation Points: 581 [?]
Q&As Helped to Solve: 963 [?]
Skill Endorsements: 172 [?]
Moderator
Featured
Sponsor
 
0
 

auto generate number with current month and year. Its Should auto generate.

If you can be more specific and/or clarify what you are having trouble with, that would be helpful in getting the best guidance.

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article