+ Reply to Thread
Results 1 to 9 of 9

Combobox change

  1. #1
    Forum Contributor
    Join Date
    12-26-2006
    Posts
    189

    Combobox change

    Hi, i have the following problem:

    I have a combobox with 2 items, wich i have to choose from. Item 1 opens a new userform by a "change" event: combobox1_change, that i use to specify some properties. After this, the combobox, stays with that item selected. Some time later, if i want to modify that properties that are in that userform, i need to choose again in Combobox1, Item1. The problem is that when i click the combobox, to make appear that userform, i need to change to item2 and again to Item1. If i click in Item1 (that is already chosen) at frst, it can't open that "properties" Userform.

    I would like to know how can i make it open a second time, without changig to Item2 and again to Item1.

    Can anyone help me?

  2. #2
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    I'm not sure I understand you correctly, but I think if you clear the combobox after the form launches. Without seeing your code, it is more difficult to help, but a line like this should work after the userform launches:

    Please Login or Register  to view this content.
    Do note: since your combobox is set to act upon change, make sure that an event doesn't launch when the combobox is set to ""

    Let me know if that helps.

  3. #3
    Forum Contributor
    Join Date
    12-26-2006
    Posts
    189
    I have 2 items:

    1st: "Air"
    2nd: "Water"

    If i click "Air" it's opened "Userform2" to select some properties and after i exit this "Userform2" the option "Air" in the Combobox1, it's selected.
    If i click "Water" it makes only the selection in the combobox.

    If my selection is "Air" and some time later i need to change "userform2" properties, i'll point to "combobox1" and click. To make "Userform2" to be showed, i need to click "Water" and finally click "Air" so that "Userform2" can be showed.

    If "Air" is selected, my intention is that when i click again in "combobox1", with "Air" selected, "Userform2" can be showed without need to make a sweep, because by clicking in "Water" once, provoques a change in some cells that i wan't.

    Thank you and sorry for the extention!

  4. #4
    Forum Contributor Tarball's Avatar
    Join Date
    04-21-2007
    Location
    Atlanta, GA
    Posts
    166
    Sounds like you are not evaluating the combo box on a Change event. Please post and example of your code showing the click event and the change event.

  5. #5
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    Mqdias:

    I fully understand the problem, however I'm not sure that you understood the solution.

    The problem: once you select "Air", it triggers a combobox change event that launches userform2. Now, the combobox says "Air" in it. If you go back to it later and choose "Air" again, the userform does not launch. This is because when the combobox says AIR and you choose AIR again, there is no change. If there is no change, it will not trigger the event.

    The solution: input code to clear the combobox as soon as the userform triggers. It would be much easier to help you if you posted the actual code. Below is a small example:

    Please Login or Register  to view this content.

  6. #6
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    Another approach might be
    Please Login or Register  to view this content.
    Edit: I had another thought, put this routine in the ComboBox1_Enter event.
    Last edited by mikerickson; 10-26-2007 at 03:46 PM.

  7. #7
    Forum Contributor
    Join Date
    12-26-2006
    Posts
    189

    Red face

    Hi all!!!

    Thank you soo much for your kindly attention and interest in this issue, tha i think that might touch many people.

    Here is my code now for one combobox. In the mid

    HTML Code: 
    BigBas,

    I think your suggestion might not work because if i say that combobox1.value="" after, it will not fix that option that i chose and it couldn't be seen after i close de 2nd userform.

    I hope you can give just a few more seconds to this question!!!

    Great! thank you once more!

  8. #8
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    I didn't realize that you wanted the combo box to display the value chosen until a new one is chosen. Since that is the case, here is another possibility. Add a new line of code in addition to your current code:

    Please Login or Register  to view this content.
    This will clear the contents of the combo box as soon as you click the drop down arrow (on the combo box). Now, even if you make the same selection, a change still occurs.

  9. #9
    Forum Contributor
    Join Date
    12-26-2006
    Posts
    189
    Big Bas,

    thank you soo much for your answer, it did help me someway, but i still have a little problem: once i choose a item from the combobox, it clears combobox content and doesn't fix my option.

    Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1