Results 1 to 11 of 11
  1. #1
    Join Date
    Jun 2009
    Posts
    95

    Unanswered: Set Default Value on ComboBox

    I have two comboboxes, in the first one the user selects the company and based on the company selection the user chooses which branch of the company in the second combobox.

    How do I go about making it so by default the second combobox auto selects its first branch? I need to do this so my subforms will populate without having to select the branch, unless the user needs to change it.

    Thanks,
    CT

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    This type of thing:

    Me.lstVendors = Me.lstVendors.ItemData(0)
    Paul

  3. #3
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    I assume you have code in the after update event of the first combo to requery or reset the source of the second combo. That's where I'd put it.
    Paul

  4. #4
    Join Date
    Jun 2009
    Posts
    95
    Where do I put that?

  5. #5
    Join Date
    Jun 2009
    Posts
    95
    I currently have the default value set to the first selection in the list, however, when I change the company in the first combobox, it goes blank.

    Thanks,
    CT

  6. #6
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Is it just on my screen, or has the site gotten the posts out of order?
    Paul

  7. #7
    Join Date
    Jun 2009
    Posts
    95
    Yeah, it did get them out of order.
    I will try what you suggested and get back to you.

    Thanks a lot,
    CT

  8. #8
    Join Date
    Jun 2009
    Posts
    95
    Ok, I just did that and it worked.

    However, the second combo box does show the first item in the list, but it does not update the subform that the second combo box is linked to.

    Any ideas on fixing that?

    Thank you so much for your help so far,
    CT

    To clarify, I have to still click the down arrow on the combo box and reselect the address to get the subform to update. Is there anyway I can get the subform to update after the first combo box is selected, based on the second combo box's data?

  9. #9
    Join Date
    Jun 2009
    Posts
    95
    SOLVED:

    I put the afterupdate for the second combobox on the afterupdate of the first one.

    Works like a charm.

    Sorry for my "newbishness." Haha.

    Thanks again,
    CT

  10. #10
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Sorry, I didn't get an email notification of your post. Glad you got it sorted out.
    Paul

  11. #11
    Join Date
    Jun 2009
    Posts
    95
    Thanks for all of your help pbaldy, it really triggered my mind to solve the problem.

    -CT

Posting Permissions

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