Results 1 to 3 of 3

Thread: Forms2 ComboBox - HELP!!!!

  1. #1

    Thread Starter
    Member
    Join Date
    May 2000
    Location
    Boston, MA
    Posts
    52

    Angry

    Hello!

    I know that the forms2 combobox can display columns, but I can't get it to work. Here's what would work in an ideal world:

    Code:
    cboForms2.ColumnCount = 2
    
    Do Until recordset.EOF
         cboForms2.AddItem (recordset!COLUMN1, recordset!COLUMN2)
         rs.MoveNext
    Loop
    Now, obviously this does not work, I just make it up. It would work in VB - lcdial Edition, but there is no such thing.

    The Help file discusses arrays, but I can't use an array b/c I don't have a recordcount, or maybe my understanding is off, PLEASE HELP ME!!! Thanks in adavnace!

  2. #2
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    617

    ...

    I See a lot of these questions

    but
    If u must, you can create
    your own quick 2 column listbox

    Add 2 list boxes to the form... next to each other so close
    that they look like one and
    do the same thing

    with just a little code u can manage it


  3. #3
    Member
    Join Date
    Aug 2002
    Location
    Chennai
    Posts
    57
    Try the following Code


    Rs.MoveFirst
    For i = 0 To Rs.RecordCount - 1
    ComboBox1.AddItem Rs("user_name")
    ComboBox1.List(ComboBox1.ListCount - 1, 1) = rs("first_name")

    ' Any No of Columns u can add similarly


    ComboBox1.List(ComboBox1.ListCount - 1, 1) = rs("ColumnName")

    Rs.movenext
    Next

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