Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2003
    Location
    Australia
    Posts
    217

    Question Unanswered: COMBO BOX problem (VB6)

    In MS Access, combo boxes can be bound to a field.
    In addition, its drop-down list can be filled with data from a table field (setting its RowSource property), usually the table is a LOOKUP table.
    In this way, the combo box can display an existing field data AND ALSO allows users to update it.

    But I discovered that I CAN'T do this in VB6.
    I can either bound it to a field OR fill its drop-down list with a field, but NOT BOTH.

    Does anybody know how can I get around this problem ?? Please help.

  2. #2
    Join Date
    Jul 2003
    Location
    Amsterdam, Nederland
    Posts
    450

    Wink Re

    Code:
    Combo1.AddItem "Nancy Davolio"
    Combo1.ItemData(Combo1.NewIndex) = 12345
    Combo1.AddItem "Judy Phelps"
    Combo1.ItemData(Combo1.NewIndex) = 67890
    or

    Code:
    Combo1.clear
    Combo1.AddItem "Select one"
    Combo1.ItemData(Combo1.NewIndex) = -1
    for i = 0 to rs.count -1
        Combo1.AddItem rs("Name")
        Combo1.ItemData(Combo1.NewIndex) = rs("id")
    next
    ComboBox1.SelectedIndex = -1
    Greetz Marvels -^.^-
    Developments : VB4 Through .Net; Basic; DOS ; CNC ; Sinclair
    Databases : SQL Server Through 2005; Access 3 Through 2003 ; Oracle 8 & 9.i ;
    OS : Win 3.11 Through XP ; NortonComander ; DOS

  3. #3
    Join Date
    Jul 2003
    Location
    Australia
    Posts
    217

    Wink reply

    I believe that would be a great answer, but , unfortunately, I am no longer using Visual Basic.

    Even if I were using it, I believe I won't be using VB6.

    Thank you anyway.

Posting Permissions

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