We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,134 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Auto Generate Number

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

3
Contributors
2
Replies
5 Hours
Discussion Span
3 Months Ago
Last Updated
15
Views
gpriya govind
Newbie Poster
1 post since Feb 2013
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 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

hometownnerd
Light Poster
37 posts since Sep 2007
Reputation Points: 21
Solved Threads: 4
Skill Endorsements: 2

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.

JorgeM
Industrious Poster
4,018 posts since Dec 2011
Reputation Points: 297
Solved Threads: 548
Skill Endorsements: 115

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.3041 seconds using 2.64MB