Listview item into text bozes

clembem
11-11-2000, 09:35 AM
I have a form (form A) with 6 text boxes and a command button. The button opens another form
(form B) with a listview of a table. Can someone tell me how to do the following:

When I double click on the a record in the listview form (form B), I want to take 6 fields and populate my 6 textboxes on the previous form (form A).

I have been working with VB for about 6 months now, mostly database connectivity.

Thanx, Brian

PWNettle
11-14-2000, 03:54 PM
You'll need form A to be loaded. You don't specify whether or not form A remains loaded when you click it to go to form B so I'm gonna assume that form A remains loaded. You should be able to do something like this in your double-click event:
<PRE> FormA.Text1.Text = ListView1.SelectedItem.Text
FormA.Text2.Text = ListView1.SelectedItem.SubItems(1)
FormA.Text3.Text = ListView1.SelectedItem.SubItems(2)
FormA.Text4.Text = ListView1.SelectedItem.SubItems(3)
FormA.Text5.Text = ListView1.SelectedItem.SubItems(4)
FormA.Text6.Text = ListView1.SelectedItem.SubItems(5)</PRE>
Rename the textboxes and listview to suit your code.

Paul

clembem
11-15-2000, 12:32 AM
Thanx much, I got it working today. After looking at your sample, I said to myself, "A DUH" Brian

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum