list box to combo box

  • Thread starter Thread starter Shaggycat
  • Start date Start date
S

Shaggycat

Hello there,

How do I set up a listbox with three values in date format 2/24/06, 2/27/06,
and 2/28/06 where the user selects one and populates a combo box using a
directory list?

For example, user clicks on 2/27/06 in the listbox, code goes to a folder in
a directory (not access or sql) and populates the combo box with the content
of the folder......

help!
 
Am I on the right track? Please I need some assistance...thank you.

Public Sub ltbDate.SelectedIndexChanged(ByVal Sender As Object, ByVal e As

EventArgs)

If ltbDate.SelectedValue = "2/24/06" Then

File1.Open "Z:\Queue Review Files\2-24\Cam 1"

Do While Not File1.EOF

data = File1.LineInputString

cmbTime.AddItem (data)

Loop

File1.Close



elseif ltbDate.SelectedValue = "2/27/06" Then

File1.Open "Z:\Queue Review Files\2-27\Cam 1"

Do While Not File1.EOF

data = File1.LineInputString

cmbTime.AddItem (data)

Loop

else ltbDate.SelectedValue = "2/28/06" Then

File1.Open "Z:\Queue Review Files\2-28\Cam 1"

Do While Not File1.EOF

data = File1.LineInputString

cmbTime.AddItem (data)

Loop

end if

End Sub
 
Hi,

Well, you're code looks Ok to me. The main point is "Does it work ? If
not, what error do you get ?"
We can move ahead from that point.

Another point, you're code looks quite VB 6.0 'ish to me. Are you sure
you're using .NET ?

Regards

Cerebrus.
 
Back
Top