Quote:

Well, you already sort the records by the computername, so just compare each record to the previous one. If they differ by more than one then there is a gap.

Here is one way of doing it:
Code:
$highNum = 0
For Each $record1 In $recordset1
If Not $highNum
$parseNum=CInt(Right($record1,5))
If $iNextNum AND $iNextNum<>$parseNum
$highNum=$iNextNum
"Gap found - using sequence number "+$highNum ?
Else
$iNextNum=$parseNum+1
EndIf
EndIf
Next
If Not $highNum $highNum=$iNextNum+1






Hi Richard,
Thanks for this example. It works perfectly!
_________________________
John
LM Contractor
One of the 2 dads