Label to ListBox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • richy176
    New Member
    • May 2007
    • 8

    #1

    Label to ListBox

    hey....does anyone know how to load a group of data that was stored in a label to open into a listbox?

    i have 2 forms, the one form is an input form where a user would input names in a textbox, when the user presses enter, the name goes into the label, i save the data, then go to the 2nd form...when i click on load i want the data from the 1st form (label) to open in a Listbox

    does anyone know how to do this?

    thanks
  • kadghar
    Recognized Expert Top Contributor
    • Apr 2007
    • 1302

    #2
    Wouldn't it be enough by adding it to the listbox??

    ListBox1.AddIte m (Label1.Caption )

    Hope that helps.

    Comment

    • richy176
      New Member
      • May 2007
      • 8

      #3
      thanks....i dont get an error anymore but nothing appears, i wanna make sure my load button works cus thats the button i press to open the name onto the listbox. here is the code

      Dim GName, YName As Variant (General Declarations)


      Private Sub cmdLoad_Click()

      Open "C:\student.txt " For Input As #1

      Input #1, GName, YName

      GList.List = GName
      YList = YName

      GList.AddItem (Student.lblGNa me.Caption)
      YList.AddItem (Student.lblYNa me.Caption)


      End Sub

      Comment

      Working...