hi<BR>i have a table called indent<BR>fields:<BR>idno ( PK)<BR>username<BR>Qty<BR><BR>in the asp page when i enter the records i want to auto increment the idno as username1, username2, username3<BR><BR>&#039 Finds maximum indentno. used for this particular user<BR> sqlstr="select * from indent where userid=&#039"&user&"&#039"<BR> set rs=conn.execute(sqlstr)<BR> if(rs.eof) then<BR> numb = 0<BR> else<BR> &#039 Increases the indent number by one<BR> indentno=rs.fields(0)<BR> response.write(indentno)<BR> numb = mid(indentno,5,10)<BR> response.write(numb)<BR> if (numb="")then<BR> numb=0<BR> end if<BR> numb = numb + 1<BR> <BR> end if<BR> <BR> &#039 concatenates userid with integer part of indent number<BR> indentno = user&numb<BR> rs.close<BR><BR>but this works only for 10 records <BR>please any body can help me i ll b greatly obliged<BR>pari<BR><BR>