用combobox的itemdata属性:在加入combobox列表时这样do while not rsCountry.eof cboCountry.additem rsCountry.field("country_name") cboCountry.itemdata(cboCountry.newindex)-rsCountry.field("country_id") rsCountry.movenext loop使用时: iCountryID=cboCountry.itemdata(cboCountry.listindex)
只是在点击事件中还要进行一次查询,查id给.tag
cboCountry.additem rsCountry.field("country_name")
cboCountry.itemdata(cboCountry.newindex)-rsCountry.field("country_id")
rsCountry.movenext
loop使用时:
iCountryID=cboCountry.itemdata(cboCountry.listindex)