| | |
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
•
•
Originally Posted by mwaora
AM trying to use a string "0000" to generate an auto number. i.e 0000 +1 to increment to 0001. how do i achieve this.
**************************************************
hope this one helps...
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
dim x as integer 'declare first variable x = 0 'set the value of your variable for x = 1 to 2000 s = len(str(x)) 'here we will check the length of x select case s case 1 x2 = "000" & str(x) case 2 x2 = "00" & str(x) case 3 x2 = "0" & str(x) case 4 x2 = str(x) end select next x msgbox str(x2)
![]() |
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Creating an array/collection that holds variables
- Next Thread: generating report footer
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





