Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - remove selected row
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

remove selected row

 Post Reply Post Reply
Author
Message
moe188 View Drop Down
Senior Member
Senior Member


Joined: 27 March 2006
Status: Offline
Points: 220
Post Options Post Options   Thanks (0) Thanks(0)   Quote moe188 Quote  Post ReplyReply Direct Link To This Post Topic: remove selected row
    Posted: 19 July 2007 at 7:03pm

hello,

how can I be able to delete/remove a selected row from the reportcontrol?
thank you,
 
Back to Top
moe188 View Drop Down
Senior Member
Senior Member


Joined: 27 March 2006
Status: Offline
Points: 220
Post Options Post Options   Thanks (0) Thanks(0)   Quote moe188 Quote  Post ReplyReply Direct Link To This Post Posted: 29 July 2007 at 1:51pm
hello,
any idea please?
Back to Top
NanoSofT View Drop Down
Newbie
Newbie


Joined: 31 July 2007
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote NanoSofT Quote  Post ReplyReply Direct Link To This Post 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)
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.250 seconds.