VB6.0中,LISTBOX控件如何实现选择了那个数据?

VB6.0中,LISTBOX控件如何实现选择了那个数据?我想实现,点击选择右侧LISTBOX里的一个时间段,然后在左边显示该时间数据库里的数据,请问怎么LISTBOX怎么体现选择了那个时间呢?

List1.Text 就是你选择的时间,比如:

Private Sub List1_Click()
MsgBox "你在ListBox中选择的时间是:" & List1.Text
End sub追问

大虾请帮我看看,这段那里有问题,系统提示是"至少一个参数没有被指定值",但是msgbox检测,str,list1.text都有数据,private sub list1_Click()
str = scan.text
strSQL=" select * from data where 部番 = ' " & str & " ' and 发行日期= ' " & list1.text & "'
m_rs.open strSQL,g_conn,adopenkeyset,adlockoptimistic
if (not m_rs.eof) then
..........
end if
m_rs.Close
end if

追答

private sub list1_Click()
dim ks as date
ks=cdate(list1.text)
strSQL=" select * from data where 部番 = '" & scan.text & "' and 发行日期>=#" & ks & "# and 发行日期<#" & ks+1 & "#"
m_rs.open strSQL,g_conn,1,1
if not m_rs.eof then
..........
end if
m_rs.Close
end sub

温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答