查不到记录 怎样才有提示呢?KVAL(TEXT1.TEXT)Adodc1.Recordset.Find VV & K & if 查找到thenmsgb
查不到记录 怎样才有提示呢? K=VAL(TEXT1.TEXT) Adodc1.Recordset.Find "VV =" & K & ""
if "查找到"then msgbox "找到" else msgbox "找不到" END IF [最优解释]
使用find必须使用 .eof来判断是否找到 Adodc1.Recordset.Find "VV =" & K & "",,,adbookmarkfirst'使用该参数将会从第一条记录开始找,否则,就会从当前记录找,一般必须加入,否则,可能会误判,判断方法就是eof属性,如果为真,就意味着没有找到记录
[其他解释]
if Adodc1.Recordset.RecordCount>0 then msgbox "找到" else msgbox "找不到" end if
[其他解释] if rs.recordcount=0 then msgbox"没有查询到数据" else ' ....显示你的数据 msgbox "已查询到数据" endif [其他解释] 用Adodc1.Recordset.RecordCount 进行判断不行,还有没有什么好的办法 [其他解释]