I have a unique ID that looks like this ABCD0000ID e.g 3 letters, 6 digit number with leading zero's and I want to increment number by 1 each time automatically, but with a text format this doesn't seem possible. Any help much appreciated .
Unique Id
Collapse
X
-
Tags: None
-
-
Originally posted by debasisdasHow Are You Trying To Generate That ?Comment
-
-
Originally posted by debasisdasU Need To Use Format Function For That.Comment
-
-
Comment
-
Originally posted by geraldinegrieveI am using Version 6.3Comment
-
Originally posted by debasisdasFrom where you got Visual Basic version 6.3 ???Comment
-
hi
there are two ways out. first is add a numeric field in the table. this field will store numeric part of the id. now genrate id as follows
dim rst as new adodb.recordset
rst.open select max(numFiled) from table
unique id = "ABCD" & format(rst.fiel ds(0).value,"00 00#") & "ID"
second way is:
1. dim intCtr as integer
2. intCtr = (load intCtr value from registry or file etc. that is saved in line 5)
3. intCtr = intCtr+1
4. unique id = "ABCD" & format(intCtr," 0000#") & "ID"
5. save intCtr to registry or file etc.
hope this will help you
regards
manpreet singh dhillon hoshiarpurComment
-
Many Thanks for that sorry I didn''t reply sooner but out of office for a few days
Originally posted by 9815402440hi
there are two ways out. first is add a numeric field in the table. this field will store numeric part of the id. now genrate id as follows
dim rst as new adodb.recordset
rst.open select max(numFiled) from table
unique id = "ABCD" & format(rst.fiel ds(0).value,"00 00#") & "ID"
second way is:
1. dim intCtr as integer
2. intCtr = (load intCtr value from registry or file etc. that is saved in line 5)
3. intCtr = intCtr+1
4. unique id = "ABCD" & format(intCtr," 0000#") & "ID"
5. save intCtr to registry or file etc.
hope this will help you
regards
manpreet singh dhillon hoshiarpurComment
Comment