+ Reply to Thread
Results 1 to 3 of 3

ListBox works, then doesn't

  1. #1
    Registered User
    Join Date
    02-24-2011
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    2

    Unhappy ListBox works, then doesn't

    I have two OptionButtons and two ListBoxes. When I click on OptionButton2, ListBox1 goes away and ListBox2 becomes visible and enabled. When I click OptionButton1, ListBox2 goes away and ListBox1 becomes visible and enabled and I set the ListIndex of ListBox1 to 0.

    Please Login or Register  to view this content.
    When I click in ListBox1, some other code is supposed to make a ComboBox visible and populate it if the user chooses a certain item in the ListBox or take the ComboBox away if they choose something else in the ListBox:

    Please Login or Register  to view this content.
    Here's what happens when I change from OptionButton1 to OptionButton2. I start with:

    1.ListBox1 works
    2.I click OptionButton2
    3.ListBox1 goes away and ListBox2 appears
    4.ListBox2 works
    5.I click OptionButton1
    6.ListBox2 goes away and ListBox1 appears
    7.ListBox1 doesn't work
    8.I click OptionButton2
    9.ListBox1 goes away and ListBox2 appears
    10.Now ListBox2 doesn't work (I originally thought it was just a problem with ListBox1, but it was a problem with both)
    11.I click OptionButton1 and ListBoxes change again
    12.we're back to step 1, with ListBox1 working again.

    I even used message boxes to help me see what was happening and this is what I found:

    1.Clicked on OptionButton2 (with ListBox1 working) - ListBox1 lost focus and OptionButton2 got focus
    2.Clicked on OptionButton1 - OptionButton2 lost focus and OptionButton1 got it
    3.Clicked on ListBox1 - OptionButton1 lost focus, but ListBox1 didn't get it
    4.Clicked on OptionButton2 - OptionButton2 got focus, but nothing lost it (that I know of)

    I'm running out of fingernails and hair. Does anyone have any suggestions on correcting the problem with my ListBoxes?

    Thank you so much.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: ListBox works, then doesn't

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    02-24-2011
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: ListBox works, then doesn't

    Attached is a sample workbook to illustrate the problem I'm having. I left enough data in it to make sure everything was working the way it had been. Everything else has been removed. Thanks so much for helping with this.
    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)

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