PDA

View Full Version : [SOLVED] UserForm disables keyboard - ???



Wizard
02-05-2005, 01:38 PM
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

Jacob Hilderbrand
02-05-2005, 03:16 PM
You can hide the User Form or make it Modless.


UserForm1.Show False
Or

UserForm1.Hide

Wizard
02-05-2005, 04:04 PM
That (modeless) did the trick - many thanks

Zack Barresse
02-05-2005, 04:21 PM
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. :)

Jacob Hilderbrand
02-05-2005, 04:49 PM
You're Welcome :beerchug:

Take Care