Results 1 to 4 of 4

Thread: ComboBox itemdata as recordset fields

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2005
    Posts
    13

    ComboBox itemdata as recordset fields

    How to make the itemdata of combobox as the recordset fields on my db?

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: ComboBox itemdata as recordset fields

    You could set the contents of a field as a Itemdata (providing the contents were numeric), but I dont think you can set it to the field itself.

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2005
    Posts
    13

    Re: ComboBox itemdata as recordset fields

    yes thats I want. the contents of the field as an itemdata on my combobox. so that i can view the contents when I press the drop down arrow.

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: ComboBox itemdata as recordset fields

    You cannot view the ItemData of a combo, it is purely a hidden property. I presume therefore that you want to add the contents of your recordset to the list.

    You can do that like this (assuming your recordset already has the data, and the field to display is the first field):
    VB Code:
    1. Combo1.Clear
    2. Do While Not(rs.EOF)
    3.   Combo1.Additem rs.fields(0)
    4.   rs.MoveNext
    5. Loop
    (just change rs to the name of your recordset)

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