After some playing I eneded up with this and it is working perfectly.
Sub one()
Dim rs As ADODB.Recordset
DoCmd.OpenQuery "TestQuery"
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open "Select * From TestQuery", CurrentProject.Connection, adOpenKeyset, adLockOptimistic
rs.MoveFirst
base = Mid(rs("Customer_ID"), 2)
rs.MoveNext
While Not rs.EOF
chk = Mid(rs("Customer_ID"), 2)
If ((chk - base) > 1) Then
s = ""
For q = base + 1 To chk - 1
s = s & Right("000000" & Trim(Str(q)), 6) & vbCrLf
Next q
MsgBox ("Missing numbers" & vbCrLf & s)
End If
base = chk
rs.MoveNext
Wend
MsgBox "Done"
End Sub
Thank you all for your help.