idx = CInt(max.Substring(7,5)) + 1 '获得最大编号的后三位顺序号,并加1
改成
idx = CInt(max.Substring(bh.length)) + 1 '获得最大编号的后三位顺序号,并加1