+ Reply to Thread
Results 1 to 8 of 8

Issue ComboBox change event

  1. #1
    Forum Contributor
    Join Date
    04-11-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    245

    Issue ComboBox change event

    Hi -

    So attached is the workbook I'm using to develop a User Form that displays different results based on a selection from a Combobox. Though I have not completed all of the cases in my 'Select Case' procedure, the code I have does seem to work as intended when I make a single selection from the Combobox. However, when I make another selection from the ComboBox, the codes doesn't seem to fire. Give it a try by running the user form and choosing any of the first three selections (i.e., GCBlack18, GCBlackF9 or GCBlackB9) and I think you will see what I mean.

    This is what I need to have happen:

    The user wants to view the details of a particular course. As an example, let say he selects GCBlack18 from the combobox. Result: the yardage values, the par values and the handicap values appear. But then lets assume the user decides he just wants to see the the details associated with the front nine. Ahhh, here something changes; while the yardage and par values remain the same, the handicap values change. Likewise, if the user then opts to view the details of the back nine only, again yardage and par values remain the same but the handicap values change. Because I have five different tee boxes with different yardages, I am creating the Select Case statements. So far in the attached workbook I have only finished the Case statements for the Black tees (i.e., case GCBlack18, GCBlackF9 and GCBlackB9). I need to make this form diplay whatever results the user desires by simply making new selections from the dropdown list in the combobox.

    Thanks,

    Grilleman
    Attached Files Attached Files
    Last edited by Grilleman; 10-24-2019 at 05:08 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    06-02-2012
    Location
    London, England
    MS-Off Ver
    365
    Posts
    397

    Re: Issue ComboBox change event

    Your code is badly indented so it's awkward to read. With that in mind I've given it a very light read over only.

    However, what strikes me as obvious is you hide the 'irrelevant' controls dependent on the selection made in 'comboboxCourseSelection' but you do not unhide them when a selection is made that would dictate otherwise.

    For example, in the below you can see how one selection hides the irrelevant and shows the relevant and the opposite selection does it the other way round.
    Please Login or Register  to view this content.
    Does that help you at all?

    Beth.

  3. #3
    Forum Contributor
    Join Date
    04-11-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    245

    Re: Issue ComboBox change event

    Hmmm. Yes. Thanks.

  4. #4
    Valued Forum Contributor
    Join Date
    06-02-2012
    Location
    London, England
    MS-Off Ver
    365
    Posts
    397

    Re: Issue ComboBox change event

    If you need more help than that you'll need to provide a lot more information about what should and shouldn't happen on your form with each possible combobox selection.

    Beth.

  5. #5
    Forum Contributor
    Join Date
    04-11-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    245

    Re: Issue ComboBox change event

    Thanks Beth for the input. It seesmto me that Ijust need a way to 'reset the form' before each new ComboBox change event.

  6. #6
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Issue ComboBox change event

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Ben Van Johnson

  7. #7
    Forum Contributor
    Join Date
    04-11-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    245

    Re: Issue ComboBox change event

    Ben -

    Thanks for this. It's a bit advanced for me so I'll need to study. Meanwhile, I was able to accomplish my goals using 'Select Case' statements. With Beth's (BanginMyHeadOnMyDesk) help I realized I could simple turn all labels and controls on and set all captions to there default values 'at the Case level' and then selectively turn them off 'at the case level' as needed.

    Still, thank you for the effort and what has become my newest learning assignment.

    Best,

    Grilleman

  8. #8
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: Issue ComboBox change event

    Hi.
    I am a little late with this one.
    As the data listing was somewhat changed in your present example.
    There is no need for complicated searches, you simply use the combobox listindex.
    As per the attached, keep things simple and easy to read.
    torachan.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] ComboBox Change Event error
    By natefarm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-25-2018, 06:04 PM
  2. Combobox change event
    By buhwheet in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-13-2015, 10:39 AM
  3. ComboBox Change Event Issue
    By Ezzard in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-09-2015, 02:22 PM
  4. Change event for comboBox
    By cmpcwil2 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-04-2006, 10:01 AM
  5. [SOLVED] Combobox change event issue
    By Excelerate-nl in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-04-2006, 08:10 AM
  6. Combobox change event only by UI
    By Excelerate-nl in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-02-2006, 11:10 AM
  7. MsgBox in Enter event causes combobox not to run Change event
    By Richard in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-06-2006, 10:55 AM

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