+ Reply to Thread
Results 1 to 8 of 8

Listbox not working properly

  1. #1
    Registered User
    Join Date
    06-04-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    54

    Listbox not working properly

    I have a list box on a form. When I activate the form it gathers data and populates the list box. When I select an item in the listbox it runs code and toggles to a different userform for user input.

    THis all works fine.

    The issue is that when I toggle back to the userform with the list box - the list box appears to populate properly but when I try and select an item on the list nothing happens.

    I am thinking that I am some how not resetting the form or the listbox when toggling back to it, but am not sure how to do that. I am using code like this to toggle between the userforms:

    Please Login or Register  to view this content.
    Thanks in advance for your help.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Listbox not working properly

    May be try Unload Me instead of Userform1.Hide


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Listbox not working properly

    What's supposed to happen when you select an item from the listbox?
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    06-04-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    54

    Re: Listbox not working properly

    When I click on an item in the listbox the code will identify what item was picked - "hide" or close that Userform and "show" or open a different user form where the user will make changes. Once the changes are done the user can go to the "home" page (previous Userform) and select another item from the listbox to go to. All works good until the program goes back to the Home userform and then when an item is selected in the listbox - nothing happens.

  5. #5
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Listbox not working properly

    if userform1 is the "home" page its code oughta be
    Please Login or Register  to view this content.
    and in userform3 you should only use
    Please Login or Register  to view this content.
    and not attempt to show userform1 again-the code in userform1 will handle that
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  6. #6
    Registered User
    Join Date
    06-04-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    54

    Re: Listbox not working properly

    Still have the same problem - "Home" userform comes up like it is supposed to and the listbox clears and re-polulates like it suppose to - but will not let me select the item on the list.

    Here is the code in the listbox:

    Please Login or Register  to view this content.

    Here is the code toggling to the userform with the listbox: Stuff you don't probably need to know but the end result is the "unload me" at the end.




    Please Login or Register  to view this content.

  7. #7
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Listbox not working properly

    can't see anything to clear or repopulate-may need to see a workbook

  8. #8
    Registered User
    Join Date
    06-04-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    54

    Re: Listbox not working properly

    Trust me - you don't want to see the workbook - it is messy and long and complicated. Here is the code that clears and populates the listbox. Thanks for your help on this it is driving me crazy and I know it is probably something simple.


    Please Login or Register  to view this content.

+ 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