Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pupulating listbox in different form 1

Status
Not open for further replies.

JohnVogel

Programmer
Apr 19, 1999
117
US
Hi,

I'm trying to populate the list box in a form based on data from a different form. Basically, what I want to do is take all the selected items from a filelist and put them in a listbox on another form.

This is the code I am using, which (needless to say) doesn't work. The list I am trying to populate is on the form "frmDone".

-----------Begin Code---------------

For I = 0 To FileListCount - 1

If File1.Selected(I) = True Then
frmDone.List1.AddItem " File1.FileName(I)
Else
End If

Next

frmDone.Show
----------End Code-------------------

Any help would be greatly appreciated.

John Vogel
john@thecompuwizard.com
 
Okay, I spoke too soon. Actually I can get the listbox populated on the other form (messed up one lil thing), however, what I really need to do is to populate the list with EACH file selected.

Here is the Code:

Code:
Private Sub btnConvertFile_Click()

For I = 0 To File1.ListCount - 1
 If File1.Selected(I) = True Then
   frmDone.List1.AddItem Me.File1.FileName
 End If
Next
frmDone.Show
End Sub

NOW, the problem is, it populate the list with only the first filename in the filelist... how can I get it to return each selected file name?

John Vogel
john@thecompuwizard.com
 
Hi,

Change you if-then statement to:

If File1.Selected(i) Then frmDone.List1.AddItem File1.List(i)

Have a good one!
BK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top