473,403 Members | 2,222 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

how to make a loop in listview?

3
here are my codes
Dim listitem As listitem
Dim FieldCount As Integer
Dim FieldLoopNo As Integer
Dim Column_Header As ColumnHeader
Dim intdate As Date


Dim i As Long

ListView1.Refresh
FieldCount = Adodc1.Recordset.Fields.Count - 1
For FieldLoopNo = 0 To FieldCount
FieldStringLenght = Len(Adodc1.Recordset.Fields(FieldLoopNo).Name) + Int(10)

Set Column_Header = ListView1.ColumnHeaders.Add(, , Adodc1.Recordset.Fields(FieldLoopNo).Name, 2000)
Next FieldLoopNo
While Not Adodc1.Recordset.EOF
On Error Resume Next

Set listitem = ListView1.ListItems.Add(, , Adodc1.Recordset(0))
For FieldLoopNo = 1 To FieldCount
On Error Resume Next
listitem.SubItems(FieldLoopNo) = Left$(Adodc1.Recordset(FieldLoopNo), 9)
listitem.SubItems(3) = Right$(Adodc1.Recordset(FieldLoopNo), 11)
listitem.SubItems(4) = Right$(Adodc1.Recordset(FieldLoopNo), 11)

Next FieldLoopNo

Adodc1.Recordset.MoveNext
Wend
ListView1.Visible = True
i need to do loop subitems,2,3 and 4 have the same data and format in date and time all that i need is the date for the subitem 2 and time for subitem 3 and lst for 4 with the lst log out tnx
Sep 20 '10 #1
0 907

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: VM | last post by:
How can I fill up a listview with text file contents? My listview has two columns and the first column fills up with a while loop: while (myString != null) { myString = sr.Readline();...
3
by: PL | last post by:
Hi, ListView doesn't seem to have the FindItem function anymore. What are you using instead of that method (other than foreach in the ListView.Items)? Thanks! PL
2
by: Mamatha | last post by:
Hi I have an application with listview.When i click on one button the data will be displayed like this in the listview: colA colB colC ----- ----- ------...
7
by: BobAchgill | last post by:
I am trying to decide which of these controls to use to implement letting my user select a full row from MyList. The MyList has several columns which would be nice to sort by at run time. The...
5
by: Wicksy | last post by:
Hi all. I have a VB.NET app with a loop running that is continually managing a number of threads AND updating a ListView object depending on the results of the worker threads. The problem I...
2
by: Al Reid | last post by:
I'm using VB 2005. I have a production application where I load a ListView with information from several sources based on user interaction. At some point I need to iterate through the Items...
3
by: Martin Panggabean | last post by:
Hello All, I've kind a logic problem ... I want to fill the listView control in VB.NET with data in my mySql table using Datareader object component. But It seems that the way of how listView...
12
by: donkeyparfait | last post by:
I am writing code to display in a listview. I have used a For/Next loop that should add a new line in the listview each time it loops. All i get now is one line when i execute the code. I tested the...
2
by: Tenowg | last post by:
Hey everyone.. I know the code below is a mess, but I have no idea what is going wrong. I am getting an MDR error whenever I do the foreach loop. If I comment out the loop it works fine, but ofcourse...
0
HaLo2FrEeEk
by: HaLo2FrEeEk | last post by:
I've got a List and a ListView. The List stores a bunch of information and the ListView displays some of it. I'm trying to add a context menu so that when I select item(s) in the ListView I can...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.