4 Replies - 1888 Views - Last Post: 20 March 2010 - 10:10 AM Rate Topic: -----

#1 blknmld69  Icon User is offline

  • D.I.C Head

Reputation: -5
  • View blog
  • Posts: 102
  • Joined: 28-November 09

drop down list put output in textbox

Posted 17 March 2010 - 09:31 AM

I have a program that when an listItem is selected from the drop down list it needs to output to two text boxes. I am stuck it will not show the output....Please Help!!!!!!!!!!!!!!!!!!!
 Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        'Displays Manager and Assistant name of store number entered
    
        Dim ListBox1 As String
        Dim ListBox2 As String
        Select Case ListBox
            Case Is = 1001
                ListBox1 = "Jeffrey Jefferson"
                ListBox2 = "Paula Hendricks"
            Case Is = 1002
                ListBox1 = "Barbara Millerton"
                ListBox2 = "Sung Lee"
            Case Is = 1003
                ListBox1 = "Inez Baily"
                ListBox2 = "Homer Gomez"
            Case Is = 1004
                ListBox1 = "Lou Chan"
                ListBox2 = "Jake Johansen"
            Case Is = 1005
                ListBox1 = "Henry Abernathy"
                ListBox2 = "Ingrid Nadkarni"

        End Select
    End Sub
End Class



Is This A Good Question/Topic? 0
  • +

Replies To: drop down list put output in textbox

#2 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 418
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: drop down list put output in textbox

Posted 17 March 2010 - 04:33 PM

Fix your Case statements. Remove the 'Is ='.

        Select Case ListBox
            Case 1001
                ListBox1 = "Jeffrey Jefferson"
                ListBox2 = "Paula Hendricks"
            Case 1002
                ListBox1 = "Barbara Millerton"
                ListBox2 = "Sung Lee"
            Case 1003
                ListBox1 = "Inez Baily"
                ListBox2 = "Homer Gomez"
            Case 1004
                ListBox1 = "Lou Chan"
                ListBox2 = "Jake Johansen"
            Case 1005
                ListBox1 = "Henry Abernathy"
                ListBox2 = "Ingrid Nadkarni"

        End Select

Was This Post Helpful? 0
  • +
  • -

#3 blknmld69  Icon User is offline

  • D.I.C Head

Reputation: -5
  • View blog
  • Posts: 102
  • Joined: 28-November 09

Re: drop down list put output in textbox

Posted 19 March 2010 - 10:10 AM

Ok thanks!
Was This Post Helpful? 0
  • +
  • -

#4 blknmld69  Icon User is offline

  • D.I.C Head

Reputation: -5
  • View blog
  • Posts: 102
  • Joined: 28-November 09

Re: drop down list put output in textbox

Posted 19 March 2010 - 10:28 AM

ok, how can i get it to take whats in the case and put it in listBox1 and ListBox2 when one of the numbers are select?
Was This Post Helpful? 0
  • +
  • -

#5 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 418
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: drop down list put output in textbox

Posted 20 March 2010 - 10:10 AM

Instead of putting the value into a string variable, add it directly to the ListBox in the CASE statements. Unless you need it in a variable for other purposes. In which case, then define what needs to happen in your code.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1