+ Reply to Thread
Results 1 to 12 of 12

Show/Hide button stops working unexpectedly

  1. #1
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Buffalo, NY
    MS-Off Ver
    Office 365
    Posts
    319

    Show/Hide button stops working unexpectedly

    I have a form with a button (cmdVendorSelectSystem) that toggles a list from a list of Vendors to a list of Systems.

    During testing I kept the initial state of the .Visible property to true. The button worked as intended - the list switched its contents, and the caption changed from "Select Systems" to "Hide Systems".

    Then, once I was happy with the working, I changed the default setting to False (ie hidden). Now, whenever I select a Vendor from the list, I want to set the state of the Visible property to true, so that the button can operate the way I want it to (it makes no sense to keep it visible unless a Vendor is being displayed). However, the code does not produce the right result, ie the button does not appear, even though the control itself reports the state of the Visible property as True! Reality does not agree with the state of the control for some reason.

    If I keep it visible all the time, then it works as it is supposed to. It's only when I try and make the button come into view that it fails.

    Any ideas?


    Tony

    PS In a try-anything-once mood I clicked on the place where the invisible button is located. mirabile dictu it worked! Even though nothing was visible, the list changed, and the button became visible once I changed the caption (see code below). I'll post this as an interim question, just in case anyone has any quick solutions, and I'll post back as I learn more.

    Here's the code to load a vendor and make the button visible:

    Please Login or Register  to view this content.
    and here's the code that 'does the work'.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Show/Hide button stops working unexpectedly

    Hello tfurnivall,

    Please could you attach a sample workbook.

    Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate.

    Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.


    Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Buffalo, NY
    MS-Off Ver
    Office 365
    Posts
    319

    Re: Show/Hide button stops working unexpectedly

    Every time I try and reply I get a message saying that I have been blocked by some sort of firewall software. Any ideas?

  4. #4
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Buffalo, NY
    MS-Off Ver
    Office 365
    Posts
    319

    Re: Show/Hide button stops working unexpectedly

    Sucuri WebSite Firewall - CloudProxy - Access Denied

    Is what I get. I tried without the attachment, but it seems still to be larger than some (uniknown?) limit.

    I'll try breaking my response down into shorter segments.

    Tony

  5. #5
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Buffalo, NY
    MS-Off Ver
    Office 365
    Posts
    319

    Re: Show/Hide button stops working unexpectedly

    Here is the .xlsm file. (Not actually - see above)

    Because it's still (very much) in development, you'll need to do the following:

    1) Run the .xlsm file
    2) Alt+F11 to get to the VBE
    3) Open form PMSForm and use F5 to run it
    4) Select the Vendors/Suppliers tab on the multi-page control
    5) Click on one of the Vendors in the list.
    6) Exit will take you out of the form, and back to the VBE

    WHAT SHOULD HAPPEN

    a) Vendor is loaded into the form fields on the tab
    b) Two buttons appear: Select Systems, and Show Competencies

    a) works, but b) doesn't.

  6. #6
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Buffalo, NY
    MS-Off Ver
    Office 365
    Posts
    319

    Re: Show/Hide button stops working unexpectedly

    One fascinating thing -if you click at the point where either of those buttons is located (check the uncompiled form to find out), then the button will appear, and it will process the click properly! (Under the State textbox, and under the PostCode textbox)

    If you look at the procedure Sub LoadVendorIntoFormFIelds, in the code page of the form, you will see that I have commented out code to HIDE each of the buttons, explicitly. If this code is UNcommented, then b) will also work.

    Thanks for your assistance,

    Tony

  7. #7
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Buffalo, NY
    MS-Off Ver
    Office 365
    Posts
    319

    Re: Show/Hide button stops working unexpectedly

    I think I have it - at one point I had anglebrackets around a comment. I think that the firewall tried to interpret this as malicious HTML code.
    Note the absence of such characters now!

    Here's the attachment,

    Tony
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Buffalo, NY
    MS-Off Ver
    Office 365
    Posts
    319

    Re: Show/Hide button stops working unexpectedly

    A little update to take away the sour taste of recent news.

    The behavior is copyable (when I copy the button to a different page in the mp control, then it also exhibits the same behavior. This makes me wonder if it is a corrupt version of code for buttons. Also, my work-around (hide the button then make it visible) works fine as long as I don't select the first entry in the list (ie ListIndex=0). This could indicate that a piece of code testing for ListIndex>0 is having some unexplained effect.

    This started as a minor annoyance, but now I'm getting really puzzled - I suppose what I should do is create a lab environment for it. I'll post back any results from that.In the meantime, if anyone has any ideas, I'd love to hear them!

    Tony

  9. #9
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Show/Hide button stops working unexpectedly

    Hello tfurnivall,

    I must be honest. I have totally lost track of what I did where in your Code, but please see if you could make do with the attached sample Workbook.

    Regards.
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Buffalo, NY
    MS-Off Ver
    Office 365
    Posts
    319

    Re: Show/Hide button stops working unexpectedly

    Hi Winon,

    Thanks for your efforts, however, they seem to have been fruitless! The buttons don't appear when they 'should', although if I click where they are despite being invisible, then they work.

    I'm really beginning to think that this is a bug. A real live bug, although I'm darned if I know how to preciptate it at will.

    Tony

  11. #11
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Show/Hide button stops working unexpectedly

    Hi tfurnivall,

    After Posting the Workbook, I also found my attempts to be fruitless.

    Hopefully I have it now sorted out, and would like to hear your feedback on the new revised attached Workbook.

    Regards.
    Attached Files Attached Files
    Last edited by Winon; 11-10-2016 at 04:16 AM.

  12. #12
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Buffalo, NY
    MS-Off Ver
    Office 365
    Posts
    319

    Re: Show/Hide button stops working unexpectedly

    Seems still to have a problem. The canonical test is:
    1) Select Vendors (list of vendors seen)
    2) Select any (I choose 1st, 2nd, 3rd, 5th and 8th) vendor
    3) Vendor data will appear in the text fields, AND two buttons will appear (This is where your version fails)

    Side-note - if you click where the buttons are meant to be, even though they are invisible, they will click into view! Go figure

    Tony

+ 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] Button to show/Hide rows not working
    By ramatthews in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-09-2015, 04:56 AM
  2. [SOLVED] Command button stops working after running other macros
    By Bearz in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-20-2015, 06:37 PM
  3. Command Button Stops Working After First Use
    By OpieWinston in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-03-2014, 06:55 PM
  4. VBA hide row based on pull down with button to toggle show/hide
    By myronr in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-12-2012, 06:07 PM
  5. Show/Hide Button
    By sdbrown81 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-17-2012, 09:19 AM
  6. Hide/Show Button
    By Kolin in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-14-2010, 07:00 PM
  7. Create button code stops working
    By Stuart in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-01-2005, 05:06 PM

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