当前位置:编程学习 > VB >>

combox显示问题

想在combox控件显示数据库某一列内容,例如物料号这一列,但是显示的内容不要重复(数据库中此列内容有重复,比如有两个垫圈12,但是控件里面只要显示一个),程序应该怎么编!!!!!!帮帮忙 select 物料号 from my_table group by 物料号 http://download.csdn.net/source/1644211 sql="select distinct 物料号 from my_table "
rs.open sql
combo1.clear
do while not rs.eof 
combo1.additem rs.fields(0)
rs.movenext
loop
set rs=nothing +1
引用 3 楼 king06 的回复:
sql="select distinct 物料号 from my_table "
rs.open sql
combo1.clear
do while not rs.eof 
combo1.additem rs.fields(0)
rs.movenext
loop
set rs=nothing
select distinct 物料号 from my_table 

QQ群 48866293 OFFICE应用挖掘 
MS OFFICE(ACCESS\EXCE\WORD等应用技术探讨与交流!技术群,请阅群论坛中的《踢人规则》
补充:VB ,  VBA
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,