如果是后台表,保存后使用sql判断效率高一点
select count(*) as 不合理数量 from {表C} as a inner join {表C} as b on a.[_Identify] <> b.[_Identify] where (a.起始编码 < b.起始编码 and a.结束编码 > b.起始编码) or (a.结束编码 > b.结束编码 and a.起始编码 < b.结束编码 )
或者使用代码遍历处理。
for each r as row in tables("表C").rows
dim dr as datarow = datatables("表C").find("((起始编码 < " & r("起始编码") & " and 结束编码 > " & r("起始编码") & ") or (结束编码 > " & r("结束编码") & " and 起始编码 < " & r("结束编码") & " )) and _Identify <>" & r("_Identify"))
if dr isnot nothing then
msgbox("不合理")