sql="select * from YourTable where Id='" & xxx & "'" set rs=cn.openrecordset(sql,opendynamic,rdconcurvalues) combobox.clear do while not rs.eof combobox.additem rs!Id rs.movenext loop
to applekiller() : 这段程序在combobox.clear的前面应该再加上: if rs.bof and rs.eof then exit sub 否则可能出错。
set rs=cn.openrecordset(sql,opendynamic,rdconcurvalues)
combobox.clear
do while not rs.eof
combobox.additem rs!Id
rs.movenext
loop
这段程序在combobox.clear的前面应该再加上:
if rs.bof and rs.eof then exit sub
否则可能出错。
if MyRS.EOF Then Exit Sub
就足够了