如何获得选定列的值 [英] How to get Selected column value

查看:55
本文介绍了如何获得选定列的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮助我!
我在粗体语句中遇到错误
它仍然是VB6,但如果您能帮助我,谢谢.

please help me!
I get an error in the bolded statement
its still VB6 but if you can help me, thank you.

Private Sub btnDelete_Click()
    Dim sql As String
    Dim x As ListItem
    lvCustomer.ListItems.Clear
    sql = "SELECT id FROM Customer WHERE isDelete = False;"
    Set rs = db.OpenRecordset(sql)
    Do Until rs.EOF
         If lvCustomer.SelectedItem.SubItems(0) = rs.Fields("id") Then
            answer = MsgBox("Do you want to delete?", vbExclamation + vbYesNo, "Add Confirm")
            If answer = yes Then
                rs.Fields("isDelete") = True
                MsgBox "Customer Deleted!"
            Else
                MsgBox "Canceled Deletion!"
            End If
            Exit Do
         End If
        rs.MoveNext
    Loop
    Call LoadList
End Sub

推荐答案

lvCustomer.ListItems.Clear



在这里,您要清除列表,然后尝试从列表视图中比较已清空项目和记录集的内容.



here you are clearing your list and then your are trying to compare from the listview that you''ve emptied items to the recordset.

If lvCustomer.SelectedItem.SubItems(0) = rs.Fields("id") Then


这篇关于如何获得选定列的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆