Re: modal windows

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Dirk Goldgar (dg_at_NOdataSPAMgnostics.com)
Date: 11/19/04


Date: Fri, 19 Nov 2004 17:27:58 -0500


"AT" <AT@discussions.microsoft.com> wrote in message
news:6B85F4AE-0494-453D-BBC9-3CEB50A9AACF@microsoft.com
> Has anyone ever come across where they have set a form with a subform
> on it to modal and it doesn't work?? I have a main popup form that
> is set to modal and it works great, it won't let you do anything else
> outside of it. But I also have a small popup form with a subform on
> it that comes up (when they click on a button back on the main form)
> and that form doesn't seem to work. If they click on the main form
> (which they can see in the background) while the small popup form is
> open, the small popup form just goes to the back behind the main
> form. I have other forms that work fine, the only thing I can figure
> it that it's because it has a subform on it. And yes, both the form
> and the subform are set to modal. Am I missing something??
>
> Thanks for any advice.

The Modal property of the form is ignored when you open the form from
code. You must specify WindowMode:=acDialog on the OpenForm statement
that opens the form:

    DoCmd.OpenForm "YourForm", _
                    WindowMode:=acDialog

-- 
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)

Quantcast