entering data into a listbox?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • arizona
    New Member
    • Dec 2007
    • 1

    entering data into a listbox?

    I am new to this and the book doesn't explain how to enter data from the user's input box into a listbox, the information is then to be calculated when you get all five grades into the listbox. For some reason I can't get the info to go into the listbox. Can anyone help me?
  • lee123
    Contributor
    • Feb 2007
    • 556

    #2
    Hi there arizona, are you going to be adding these things in code? does you form have just a listbox and a button? because if it has these things you might want to try this:

    example:

    Code:
    Private Sub Command1_Click()
        
        Dim command1 As String
        command1 = inputbox("AddItem")
        List1.AddItem "What ever you want to add"
        List1.AddItem "What ever you want to add"
        'and so on
    
    End Sub
    lee123

    Comment

    • lee123
      Contributor
      • Feb 2007
      • 556

      #3
      im sorry this will only add the items as soon as you run the program not with the inputbox. maybe someone else can modify it to use the inputbox. sorry

      lee123

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        You are using inputbox or textbox for user input ?
        If using inputbox then try this sample code

        [code=vb]private sub command1_click( )
        dim s1 as string,s2 as string, s3 as sting
        list1.clear
        s1=inputbox("en ter grade1")
        list1.additem s1
        s2=inputbox("en ter grade2")
        list1.additem s2
        s3=inputbox("en ter grade3")
        list1.additem s3
        end sub[/code]

        Comment

        Working...