Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8797427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:51:17+00:00 2026-06-13T23:51:17+00:00

i am currently developing my vb6 program but having a problem in displaying one

  • 0

i am currently developing my vb6 program but having a problem in displaying one listview from two tables .. on first try it runs correctly, it stores my info like name, address, age etc. on their assigned columns but on the second run. the infos multiplies and just placed on the 1st column of the list view 🙁
here is my code on the listview form:

Private Sub Form_Activate()
Set rs = New ADODB.Recordset
With rs
.open "Select * from tblapps , tblappsinfo", cn, 3, 3
ListView1.ListItems.Clear
Do Until rs.EOF
    ListView1.ListItems.Add = !Name
    ListView1.ListItems.Item(1).ListSubItems.Add = !address
    ListView1.ListItems.Item(1).ListSubItems.Add = !tin
    ListView1.ListItems.Item(1).ListSubItems.Add = !cel
    ListView1.ListItems.Item(1).ListSubItems.Add = !College
    ListView1.ListItems.Item(1).ListSubItems.Add = !age
    ListView1.ListItems.Item(1).ListSubItems.Add = !Status
    ListView1.ListItems.Item(1).ListSubItems.Add = !Salary_Desired
    ListView1.ListItems.Item(1).ListSubItems.Add = !Hours_can_work
    ListView1.ListItems.Item(1).ListSubItems.Add = !Available_for_work



  .MoveNext
  Loop
End With
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T23:51:18+00:00Added an answer on June 13, 2026 at 11:51 pm

    You’re not updating the index for the item when you’re adding sub-items for subsequent records, it’s always adding it to Item(1).

    What you want instead in your example is

    ListView1.ListItems.Item(ListView1.ListItems.Count)
    

    that way the sub-items are always being added to the newest item.

    But be careful! If the Sorted property is true while adding, the most recent may not be the last one. In that case, you could add each item with the name as its own key:

    ListView1.ListItems.Add , !Name, !Name
    

    then reference by the key instead of the index

    ListView1.ListItems.Item(!Name)
    

    However, it’s probably better and easier (avoiding key collision issues) to just turn off sorting before the loop with ListView1.Sorted = False and turn it back on after the loop with ListView1.Sorted = True.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently developing a PHP framework and have ran into my first problem. I need
Problem background I am currently developing a framework of Ant Colony System algorithms. I
I currently developing a multi-language interface for a Django project. But when I started
Im currently developing a program that uses a scrollable/zoomable image as the main user
I am currently developing a program (C++ Win32, Visual Studio 2012) that captures audio
Currently developing my first Native iPhone application, the application is going to be integrating
Im currently developing a system where the user will end up having large arrays(
Im currently developing an API, and one thing that I decided was to have
I´m currently developing a Struts2 app where a user will make one of three
I am currently developing a site for a client (http://184.168.136.225/). Having some issues with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.