vb 6.0 如何取list选中的值

Dim iState As Integer
Dim i As Integer
Dim tmpTime As String
Dim strSQL1 As String
Private Sub Form_Load()
labAgentID.Caption = AgentIDStr
End Sub

Private Sub qctsr_Click()
strSQL1 = "update tel_116114 set qctsr = " & labAgentID.Caption & ",******************************************************************************qcstate = '" & List1.List & "',就这句我不知道如何取得list1被选中的值***********************************************************************************qcdate =(select replace(replace(replace(CONVERT(varchar, getdate(), 120 ),'-',''),' ',''),':','')) where RECORDID = " & CLng(frmCATI.labRecordID.Caption)

conn.Execute strSQL1

tel.Text = ""
qcremark.Text = ""
End Sub

用 List1.ListIndex 属性。
这个属性即为当前被选定的项目序号,从0开始。
如果没有项目被选中,该属性=-1。
所以如有必要,需要判断一下。
温馨提示:答案为网友推荐,仅供参考
第1个回答  推荐于2018-05-10
List1.Text
List1.List ( List1.Listindex)本回答被网友采纳
相似回答