"Can't show non-modal form when modal..." vs Windows 2000

I've written a VB6 program and it is installed on 35 various workstations.

I'm getting error 401 "Can't show non-modal form when modal form is displayed" in a couple of places, on two Window 2000 (Sp2) machines with the latest Windows updates ran on them. However, this error never occurs on the Windows98 & NT4 workstations. And also doesn't occur on 5 other Windows 2000 workstations (Sp2) that haven't had the Windows updates run.

Also on these two machines modal forms sometimes open frozen (as if Form.Enabled = False) where clicking on them does nothing but Escape/Alt+F4 do close the form.

I think the error could possibly be linked to a modal form that's hidden, but why work on the other 33 machines???

Assistance would be much appreciated
Who is Participating?
SpideyModConnect With a Mentor Commented:
per recommendation

Community Support Moderator @Experts Exchange

This is something in ur code which one modal form is there and then the code want another modal form to display. to solve this problem, u must make sure that in ur code, there are no functions to call another modal form before u close the previous one. MODAL FORM ARE ALWAYS VISIBLE, so, there is no invisible possibility.

And this is not a problem of what version of windows (at least win32), or service pack.

Before we throw out the idea that it is not the OS...

Can you make the app freeze consistently on those W2K machines that are patched?  And if you use that same scenario that freezes it there.. when you perform these exact steps on an unpatched machine, does it not seize up/give errors?

Often, in consistent behaviors between different OS or between different machines on the same OS are the result of a "timing" issue.  Not all event fire synchronosly.  It's possible on two different computers that on one computer the code executes a form load, and while that form is loading some other event code fires.  While, on another computer, the form might load so quickly that the other event fires after the form loads.

The behavior points to the likelyhood that you are not managing your forms properly.  The most common mistake is referencing properties or controls on a form that was not currently loaded.  In some cases, this will cause the form to be loaded, but not be visible.  You generally know when this is happening, because you close your main window and your application keeps running.  This happens a lot when people cut and paste code from one form to another.  Their might have been form name references in the code that was copied that never got changed.

Modal forms are another matter.  The only want to get a form to be modal is to explicitly show it as modal.  It should be fairly easy to search for all instances where you are showing a form modally, and then look within the code for that form and see if there are any instances where you are show another form.
Hi RobertEnglish,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Save as PAQ -- No Refund.

RobertEnglish, Please DO NOT accept this comment as an answer.
EXPERTS: Post a comment if you are certain that an expert deserves credit.  Explain why.
DanRollins -- EE database cleanup volunteer
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.