Home All Groups Group Topic Archive Search About

list box to combo box

Author
21 Mar 2006 7:09 PM
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!

Author
21 Mar 2006 9:10 PM
Shaggycat
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




Show quoteHide quote
"Shaggycat" <shaggy***@nomail.com> wrote in message
news:uPikzrRTGHA.424@TK2MSFTNGP12.phx.gbl...
> 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!
>
Author
22 Mar 2006 11:51 AM
Cerebrus
Hi,

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

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.