* Charlie * Sample LI2456EX * to LI02456EX Local lReplaceMe Local cPartNo, cPrefix, cGrab, cSKU, cNewSKU, cSuffix, cNewPartNumber Local i, nPreCount, nMidCount, nEndCount * Put this in a (Do While Not query.rowset.endOfSet) LOOP cPartNo = "LI2456EX" && Get this from your table field lReplaceMe = False cPrefix = "" cSKU = "" cNewSKU = "" cSuffix = "" cNewPartNumber = "" * First grab the prefix letters * For nPreCount = 1 to Len(cPartNo) * cGrab = SubStr(cPartNo,nPreCount,1) * * If it's a letter, add it to the prefix. If Val(cGrab) = 0 cPrefix += cGrab Else Exit Endif * Next nPreCount * Grab the middle numbers For nMidCount = nPreCount to Len(cPartNo) * cGrab = SubStr(cPartNo,nMidCount,1) * If cGrab = "0" cSKU += cGrab Loop Endif * If Val(cGrab) > 0 cSKU += cGrab Else Exit Endif Next nMidCount * Grab the suffix For nEndCount = nMidCount to Len(cPartNo) * cGrab = SubStr(cPartNo,nEndCount,1) cSuffix += cGrab * Next EndCount * You mentioned that the SKU has to have 4 numbers in it... If Len(cSKU) = 4 cNewSKU = "0" + cSKU lReplaceMe = True Endif If lReplaceMe = True cNewPartNumber = cPrefix + cNewSku + cSuffix * * Replace the rowset.Field * Endif ? "Prefix " + cPrefix ? "SKU " + cSKU ? "Suffix " + cSuffix ? "New SKU " + cNewSKU ? "New part number " + cNewPartNumber