borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Visual Basic Tutorial)Next Topic (Expression evaluator) New Topic New Poll Post Reply
AndreaVB Forum : VB General : Listview
Poster Message
jotabe
Level: Big Cheese

Registered: 26-06-2003
Posts: 23

icon Listview

Hello, eveybody.  I created a form (VB6) and I put a listview with checkboxes on it. This listview loads some records from a table (Access 2000).  So far so good !   So, after the records are displayed, I'd like to mark some checkboxes  and to check  in other table if this record exists. For instace :
Let's suppose I have two tables : A and  B. I show all of records from table A and after marking some checkboxes I'd like to check  if a specific record exists in table B. If it is True I'd do some changes in table A and after in table B. Just that !!   The property listview.selecteditem shows the item I selected and not the information about the record from some field. I'd like to refer a record from a specific field (column in DB).

Well, if someone could help me with some codes, some tips I'be thankfull.

JotaBeBr

09-01-2007 at 05:02 AM
View Profile Send Email to User Show All Posts ICQ | Quote Reply
jotabe
Level: Big Cheese

Registered: 26-06-2003
Posts: 23
icon Re: Listview

I got it.  It is the property subitems from listview. Just for instance :

For i = 1 To ListView1.ListItems.Count
    
       If ListView1.ListItems(i).Checked = True Then
        a = a + 1
        
        Set MyRs = New ADODB.Recordset
        
        MyRs.Open "MyTable", conn, adOpenKeyset, adLockOptimistic
        MyRs.Find "MyField=" & ListView1.ListItems(i).SubItems(1), 0, adSearchForward, 1
        
   '  here goes other commands.....and so on
          
    End If
    
    Next


Even so,  thanks all.

JotaBeBR              

14-02-2007 at 04:38 AM
View Profile Send Email to User Show All Posts ICQ | Quote Reply
AndreaVB Forum : VB General : Listview
Previous Topic (Visual Basic Tutorial)Next Topic (Expression evaluator) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder