![]() ![]() UseItemStyleForSubItems false Then the UseItemStyleForSubItems property must be incorrect. Is the item number including the line number. I know theres a lot more you can do about it but I took a chunk out of my frustration with control and think its too friendly for my application. Text and the data in this article is displayed by the database at Listview2. Then I have on button2 the selected sentence where it is the text box. I've changed the for statement as well to go from 0, one other little change is to where you are setting the value in SubItems(2) so it will concatenate all of the items and not just put the last one you get to in the recordset.Remember that the ListViewItem class text function is the first column of data in the ListView control. List.SubItems(2) = list.SubItems(2) & " " & ListView1.ListItems(i).ListSubItems.Add(,, my_Recordset1.Fields(0)) My_Recordset1.Open sSql1, Conn1, adOpenDynamic, adLockOptimistic my_Recordset1.MoveFirst SSql1 = "select name from company where product LIKE '" & ListView1.ListItems(I) & "'" If ListView1.ListItems(i).Checked = True Then Going on the comment below you need to put the while inside the for statement so your code would look something like this: For i = 0 To -1 each VB6 For each, it is worth a look when you are doing things like this. While you are changing your code have a look at a for. That way you will be getting the right information for the list item you are looking at. List.SubItems(2) = ListView1.ListItems(I).ListSubItems.Add(,, my_Recordset1.Fields(0)) ![]() query= "select name from company where product LIKE '" & ListView1.ListItems(I) & "'" If ListView1.ListItems(I).Checked = True ThenĮx. It would look something similar to this: For I = 1 To ![]() Try moving the select code inside the if statement and see if that helps. ![]() If memory serves me the ListItems are a 0 based so what you have asked for is the text from the first item in the listview. Looking at the code that you've put above I think you have got your select in the wrong place. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |