473,398 Members | 2,113 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,398 software developers and data experts.

How to show Info In a Listview

lee123
556 512MB
i am doing test program to understand how to fill a listview with information i enter in another form and also using VB6 but so far unsucessfull. in one form i am using an ADODC control to put information in an access database i have created the fields consist of ClientID, FirstName, LastName,Address, City, State. etc. on another form i have a Listview control. i want to know how i can get the information that i have entered in the first form onto the second form when i open it. so far i can only retrieve the fields of the first entry and not all the information in the database here is my code for the second form *Listview"

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2. Dim LHeader As ColumnHeader
  3. Dim LItem As ListItem
  4.     lwidth = ListView1.Width - 5 * Screen.TwipsPerPixelX
  5.     ListView1.ColumnHeaders.Add(1, , "ClientsID", lwidth / 7) = "Clients ID"
  6.     ListView1.ColumnHeaders.Add(2, , "FirstName", lwidth / 4) = "First Name"
  7.     ListView1.ColumnHeaders.Add(3, , "Lastname", lwidth / 4) = "Last Name"
  8.     ListView1.ColumnHeaders.Add(4, , "Phone", lwidth / 5) = "Phone"
  9.     ListView1.ColumnHeaders.Add(5, , "Cell", lwidth / 5) = "Cell"
  10.     ListView1.View = lvwReport
  11.     Set LItem = ListView1.ListItems.Add(1, , NewClients.ClientsID.Text)
  12.     LItem.SubItems(1) = NewClients.FirstName
  13.     LItem.SubItems(2) = NewClients.LastName
  14.     LItem.SubItems(3) = NewClients.PhoneNumber
  15.     LItem.SubItems(4) = NewClients.CellNumber
  16. End Sub 
how can i get the rest of the information instead of just one. for example i enter in all the fields then save then enter in another set a fields and save it so now i have two separate information but when i open up the second form there is only the first line of information and not the second one how do i get then all to show. please help me with this code i show you

lee123
Feb 18 '10 #1
4 1483
Hi Lee123,
I think you are trying to load from first form to the second form. Your problem will be solved if you load ListItems from Database since you have saved your information in database.

Thanks
Feb 18 '10 #2
Hi Lee123,

Here is my attached help.

Good Luck
Attached Files
File Type: zip Loading ListView Items frm Database.zip (9.7 KB, 86 views)
Feb 18 '10 #3
lee123
556 512MB
kinwang2009,
thank you for the help. and it works is there anyway you could explain this code to me. because i am not good with recordsets just from the (ADODC1) control way i would like to know a little more about this connection so i can continue to use it and understand it.

lee123
Feb 18 '10 #4
Hi Lee123,

It will be my pleasure to explain you all but i find it is bit time consuming. In this regard I advise you to go through Connection string tutorials. If you dont understand that tutorials then I will explain through email or chat.

I feel this connection string in simple and most efficient way to connect to your databases.

Thankx
Feb 19 '10 #5

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

Similar topics

6
by: Joaquin Grech | last post by:
Hi I did alot of research on this on the web and msdn and I couldn't find anything. I have a listview showing as a grid (table looking, with rows and columns and no images at all, only text)....
2
by: Paddy | last post by:
private void listView1_SelectedIndexChanged(object sender, System.EventArgs e) { textBox1.Text = this.listView1.Items.SubItems.Text; } This will display sub item after cklicking on item I...
10
by: gsb58 | last post by:
Hi! I haven't worked with streams before. On a form I have: A. cboValues = A combobox with text values where the user can choose a value B. txtText = A textbox where the user can enter...
0
by: Lucky | last post by:
hi guys, i'm looking for a soultion that helps me to show the subitem text of the listview control in the tooltip when the mouse pointer hovers on the subitem. i've found on solution, according to...
1
by: Steve | last post by:
OK, I am stumped. I cannot for the life of me get images to show in ListView items while the view is set to Details. I create an ImageList, set the SmallImageList to point to the ImageList, then...
4
by: mfc | last post by:
How do i get the type info in a static method? for instance in the code below is it possible for the Method to get the type to know what type was used to call Method? thanks class C {
1
by: deerchao | last post by:
I set ListView.Dock to Top, but how can I get the desired height to avoid it to show vertical scrollbar? I mean is there something like ListView.ClientSize or ListView.VirtualHeight? Thanks!
11
by: Armin Zingler | last post by:
"Bill Schanks" <wschanks@gmail.comschrieb Try to execute lvMembers.beginupdate before filling and lvMembers.endupdate
1
by: Jackmac | last post by:
Hi there, Hopefully an easy one for someone. I'm writing a small app (Visual Studio 2008) which will take an existing access database we have and show it in a form I'm writing. The fields have...
0
by: mesut | last post by:
Hi colleagues, I've a very strange problem here. I have no clue whyt it happens. I have a listview. The Listview populates well. I have an Update Button in the listview and a...
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?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.