Results 1 to 3 of 3

Thread: Saves empty first item in combo box

  1. #1

    Thread Starter
    Frenzied Member aikidokid's Avatar
    Join Date
    Aug 2002
    Location
    Bristol, UK
    Posts
    1,968

    Arrow Saves empty first item in combo box

    I can't seem to work out why I always have an empty first item in my combo box.
    I use this code to add to the new (empty) combo box
    VB Code:
    1. cmbNotes.AddItem txtTitle.text
    and this code to save the combo box list to a file
    VB Code:
    1. Open App.Path & "\MODATA\cmbNotesList.mo" For Output As #filenum
    2.     For ctr = 0 To cmbNotes.ListCount - 1
    3.             Write #filenum, cmbNotes.List(ctr)
    4.     Next ctr
    5. Close #filenum
    Anybody got any idea why?
    Thanks

    aikidokid

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    hard to tell w/o more code etc..

    try clearing the cmbo first?

    cmbNotes.clear

    or maybe just do a check for blank entries?...

    VB Code:
    1. For x = 0 To cmbNotes.listcount -1
    2. If Trim(cmbNotes.list(x)) = "" Then cmbNotes.removeitem(x)
    3. Next

    as I said..hard to tell w/o seeing more whats going on
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3
    Frenzied Member andreys's Avatar
    Join Date
    Sep 2002
    Location
    Los Angeles
    Posts
    1,615
    Before you are adding item to the ComboBox try to Clear it first

    Combo1.Clear

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width