Consulting

Results 1 to 5 of 5

Thread: UserForm disables keyboard - ???

  1. #1
    VBAX Regular
    Joined
    Jun 2004
    Posts
    36
    Location

    UserForm disables keyboard - ???

    I have a macro that uses a UserForm as soon as it starts to allow the user to select (or add, or delete) a customer for which the report is to be run.
    When the "run" button is clicked, the UserForm is unloaded, then the main macro is called.

    During the development process, of course I need to check how it handles different scenarios, missing or incorrect data etc. The easiest way for me to do this is entering Debug mode via a Stop command then walking thru the section I'm testing, mucking around with the spreadsheet as needed, & walking thru the section under test again. Or if it hits an error (for example, it tries to match "Inventory" and the cell inadvertently contained "Inventory ") I like to make the corrections as needed then continue on my merry way.

    The problem is: For some reason, when I enter Debug mode, and I want to modify a cell in the spreadsheet to test something or correct an error, the keyboard is disabled somehow. No cursor keys, no numbers, no letters, no bodyknowsthetroubleiveseen, no escape..... but the mouse cursor works just fine. Cancel the macro - everything's ducky.

    When I stop other macros in the same workbook (that don't use a userform) & enter debug mode, there's no problem at all. I've also run a code cleaner, & it didn't help.

    When this finally gets out to the users, it shouldn't matter, but during development it's a royal pain in the... elbow! Happens on both an IBM laptop & a no-name-no-problems desktop.

    Is there a setting or something in a userform that would cause this?

    Thanx in advance....
    Wizard

  2. #2
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    You can hide the User Form or make it Modless.

    UserForm1.Show False
    Or
    UserForm1.Hide

  3. #3
    VBAX Regular
    Joined
    Jun 2004
    Posts
    36
    Location
    That (modeless) did the trick - many thanks

  4. #4
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    Yes, UserForms will default as Modal. You can make them vbSystemModal or vbApplicationModal. This means that you must deal with the userform before you can access anything else. So vbApplicationModal is the default (assumed) but you can force the user to deal with the userform before even switching applications. Fyi.

  5. #5
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    You're Welcome

    Take Care

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •