I think I might be having trouble with a padzero function. If a default institution set default id numbers to 3 digits, then enterd many record id&#039s, then later reset their default id numbers to 4 digits, many of the previous id&#039s later get rejected based on this code:<BR><BR> rs("InstitutionCode") = Session("InstitutionCode")<BR> sTempStr = Right(Trim(Request.Form("txtMemberID")), _<BR> Len(Trim(Request.Form("txtMemberID"))) - InStr(Trim(Request.Form("txtMemberID")), "-"))<BR> rs("MemberCode") =padzeros(sTempStr, Session("DefaultEmpIDDigits"))<BR><BR>When the 3 digit code comes up from the database something causes the record to not be found because in this case ("DefaultEmpIDDigits") is set to 4 digits. Any workaround for this?<BR><BR>Here is the function. Also does anyone have the time to explain how it works? Thanks in advance.<BR><BR>Function padzeros(sTemp,sMaxLength )<BR> stemp=trim(sTemp)<BR> slen=len(sTemp)<BR> if slen &#060;= sMaxLength Then<BR> for x= 1 to (sMaxLength - slen)<BR> sZero = sZero & "0"<BR> next <BR> padzeros = sZero & sTemp<BR> ElseIf slen &#062; sMaxLength Then<BR> padzeros = Left(sTemp, sMaxLength)<BR> end if<BR>end function