Print Page | Close Window

remove selected row

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=7633
Printed Date: 18 July 2025 at 9:46pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: remove selected row
Posted By: moe188
Subject: remove selected row
Date Posted: 19 July 2007 at 7:03pm

hello,

how can I be able to delete/remove a selected row from the reportcontrol?
thank you,
 



Replies:
Posted By: moe188
Date Posted: 29 July 2007 at 1:51pm
hello,
any idea please?


Posted By: NanoSofT
Date Posted: 31 July 2007 at 6:47am
In Classic VB use this sub
the name 'lst' refer to the report control

Sub Delete()
Dim i As Long, Row As ReportRow
 If lst.SelectedRows.Count = 0 Then
    If lst.Records.Count = 0 Then
       Debug.Print "No Row(s) Exist to Remove"
    Else
       Debug.Print "Select The Row(s) you want to remove"
    End If
 ElseIf lst.SelectedRows.Count >= 1 Then
         Debug.Print "Ready TO Remove : " & lst.SelectedRows.Count & " Row(s)"
         If MsgBox("Are You Sure", vbInformation + vbYesNo) = vbNo Then
           lblStatus.Caption = "Remove cancelled"
           Exit Sub
         End If

         For Each Row In lst.SelectedRows
             Delete Row
             lst.Records.RemoveAt (Row.Record.Index)
         Next
        
         Debug.Print "Selected Rows removed successfully"
         lst.Populate
 End If
End Sub

try the reference next time (Codejock Path\help\SymbolReference.chm)



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net