Results 1 to 7 of 7

Thread: Combo Box

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2004
    Posts
    10

    Combo Box

    I have a combo box that displays items from a database when the form is loaded.

    When the user selects one of the items from the list I then need to display items from another database in a list box.

    Combo box is cboCategory

    I tried if cboCategory="XXXXX" then
    etc

    Any help to get me in the right direction would be appreciated.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    You must populate the listbox in the Change event of the combobox.

    You check the combobox value like this:

    VB Code:
    1. Combo1.List(Combo1.ListIndex)

    Depending upon the value there, you can populate your listbox.

  3. #3
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171
    The change event of a combo box works like the one of a textbox. When you type in the "text" part of the combo box, it's fired. If you want to detect when one of the options was selected, you'll need the click event


    Has someone helped you? Then you can Rate their helpful post.

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Typo.


    No, really... typo. <--- blushing.

  5. #5
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632
    The change evenmt is ONLY fired if the combo is of a standard combo style, and only if you keypress in the combo.
    If you drop the list down and select an entry then ONLY the click event gets fired.

    If the combo is a drop down list then the change event NEVER gets fired, even if you keypress on it.

    Just thought I'd point that out...but you lot knew that anyways

    Woka

  6. #6

    Thread Starter
    New Member
    Join Date
    Apr 2004
    Posts
    10
    So from what I can get from the above posts when you select an
    item from a dropdown combo box you need the on click event.

    Does that mean I dont need to have any logic in my text box. ie do I put all the logic in my combo box so then when something is selected it displays items in the text box?

  7. #7
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Correct.

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