+ Reply to Thread
Results 1 to 8 of 8

ComboBox ghost

  1. #1
    Registered User
    Join Date
    11-15-2022
    Location
    Washington State, USA
    MS-Off Ver
    360 ProPlus
    Posts
    31

    ComboBox ghost

    I have a two worksheets in the workbook I am working on. The first worksheet contains a combo box. The second worksheet contains the data used in the combo box. Everything works fine except if I choose a website in the combo box and then click on the Database button, there is what I am calling a 'ghost' on the database workbook. It will not go away until you single click on the ghost and then it disappears. I have been inserting code for screenupdating true and false in multiple locations in my code but nothing has worked.

    If anyone can help, it would be greatly appreciated.My Password Vault -For Others.xlsm

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: ComboBox ghost

    It's not clear to me what you mean by this "ghost". Perhaps a screenshot pointing out would help.

    As a side question from me, why have you decided to disable the X to close the form? I design and build tools like this for a living and would never do that. I inherited a tool that had that functionality built in and it was the first thing I removed when redeveloping it. As computer users we're conditioned to use that top right corner to close things down, so doing so then being shown a message saying "don't do it this way you're used to doing it, do it this other awkward way instead" is an annoyance to the end user.
    If it's that some action can be performed whilst clicking your close button then all that can be handled in the query close event of the userform itself and you'll have happy end users. Well, happier...

    BSB

  3. #3
    Registered User
    Join Date
    11-15-2022
    Location
    Washington State, USA
    MS-Off Ver
    360 ProPlus
    Posts
    31

    Re: ComboBox ghost

    After selecting from the combo box and clicking the Database button here is what the database worksheet displays. If I click on the Ghost, it disappears.
    Excel - Ghost.jpg

    In response to the close button, I wanted to make sure any modified files were saved on close so put code behind the close button.

    Thanks for your input. If you have other suggestions, I welcome it.
    Last edited by TeacherWart; 01-08-2023 at 02:25 AM.

  4. #4
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: ComboBox ghost

    The below sub is causing the ghost
    Please Login or Register  to view this content.
    Is it necessary to have this for a specific reason?

    As for my comment on the close button, rather than have the message box on the X and a separate close button that just saves the file and closes the form, you could just use the below sub and it will do the same.
    Please Login or Register  to view this content.
    BSB

  5. #5
    Registered User
    Join Date
    11-15-2022
    Location
    Washington State, USA
    MS-Off Ver
    360 ProPlus
    Posts
    31

    Re: ComboBox ghost

    Thank you. You are correct about the offending code. I wanted the dropdown list to be filtered as the user typed characters of the website. I found this code worked using the OnChange event. If there is a better way of having this work as intended, your input would be valuable. And, thank you for the UserForm_QueryClose event coding.

  6. #6
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: ComboBox ghost

    Give this a try:
    1) Create a standard module and call it Variables (or something similar)
    2) In that module add the below line
    Please Login or Register  to view this content.
    3) Add the below line to the start of your GoToDatabase sub
    Please Login or Register  to view this content.
    4) Add the below line to the end of your GoToDatabase sub
    Please Login or Register  to view this content.
    5) Change your combobox change event code to the below
    Please Login or Register  to view this content.
    This should only run the change event when you want it to and prevent it running when you don't, which should stop the ghost showing up.

    BSB

  7. #7
    Registered User
    Join Date
    11-15-2022
    Location
    Washington State, USA
    MS-Off Ver
    360 ProPlus
    Posts
    31

    Re: ComboBox ghost

    Your fix worked perfectly. Thank you so much. Your help is very much appreciated.

  8. #8
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: ComboBox ghost

    Glad I could help and thanks for the feedback.

    Give us a shout if you need more help with the project.

    BSB

+ 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] Ghost buttons ???
    By dentler in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-22-2021, 06:38 PM
  2. [SOLVED] Ghost Add-In
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-10-2019, 05:04 AM
  3. Ghost last cell used
    By Zagrijs in forum Excel General
    Replies: 4
    Last Post: 02-27-2012, 08:00 AM
  4. Ghost Reference
    By pikapika13 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-30-2006, 03:40 PM
  5. ghost macro
    By gevans in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-08-2006, 12:45 PM
  6. [SOLVED] I seem to have a ghost macro.
    By SongCoyote in forum Excel General
    Replies: 1
    Last Post: 09-12-2005, 09:05 PM
  7. Ghost of Excel
    By Paul - NottsUK in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-05-2005, 03:06 PM

Tags for this Thread

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