Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Runtime error 401 - Can't show non modal form when modal form is displayed.

3,390 views
Skip to first unread message

thepeacemaker via VBMonster.com

unread,
Apr 9, 2008, 4:01:30 AM4/9/08
to
Hi All,

When I run my program I keep getting this message:

Run-time error 401
Can't show non modal form when modal form is displayed.

Does anybody know what this error means and how do I fix this error?

Thankyou and God Bless

--
Message posted via http://www.vbmonster.com

Bob O`Bob

unread,
Apr 9, 2008, 4:32:47 AM4/9/08
to
thepeacemaker via VBMonster.com wrote:
> Hi All,
>
> When I run my program I keep getting this message:
>
> Run-time error 401
> Can't show non modal form when modal form is displayed.
>
> Does anybody know what this error means and how do I fix this error?
>

It means precisely what it says.

What part is unclear to you?

Bob
--

thepeacemaker via VBMonster.com

unread,
Apr 9, 2008, 5:06:54 AM4/9/08
to
How to get rid of this error. I have just used normal forms in my program.

--
Message posted via VBMonster.com
http://www.vbmonster.com/Uwe/Forums.aspx/vbasic-controls/200804/1

Jan Hyde (VB MVP)

unread,
Apr 9, 2008, 8:44:17 AM4/9/08
to
"thepeacemaker via VBMonster.com" <u39727@uwe>'s wild
thoughts were released on Wed, 09 Apr 2008 09:06:54 GMT
bearing the following fruit:

>How to get rid of this error.

Don't show a non modal form while a modal form is being
shown.

Do you understand what modal and non modal is?

--
Jan Hyde

https://mvp.support.microsoft.com/profile/Jan.Hyde

Rick Raisley

unread,
Apr 9, 2008, 8:49:26 AM4/9/08
to
"thepeacemaker via VBMonster.com" <u39727@uwe> wrote in message
news:8269222b18e1c@uwe...

> Hi All,
>
> When I run my program I keep getting this message:
>
> Run-time error 401
> Can't show non modal form when modal form is displayed.
>
> Does anybody know what this error means and how do I fix this error?
>

This usually occurs when you open/display a modal form using a command such
as:

SortScreen.Show vbModal

And then, try to show another form, non-modal from that form, such as:

NewScreen.Show

A modal form is one that must be closed before program execution can
continue with the code following the Show command. If a modal form is open
(by using vbModal), and you want to open another form, it too must be Modal.
Otherwise, you get the error you are getting. Just add the vbModal to the
second Show command.

--
Regards,

Rick Raisley


0 new messages