A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

modal windows



 
 
Thread Tools Display Modes
  #1  
Old November 19th, 2004, 08:37 PM
AT
external usenet poster
 
Posts: n/a
Default modal windows

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.
  #2  
Old November 19th, 2004, 10:27 PM
Dirk Goldgar
external usenet poster
 
Posts: n/a
Default

"AT" wrote in message

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)


  #3  
Old November 20th, 2004, 01:39 AM
Albert D. Kallal
external usenet poster
 
Posts: n/a
Default

Of course, you realize that sub-form is just a control on the parent form.

So, when you set a form as model, then of course the sub-form being part of
the form is also model.

However, you do NOT want to confuse model forms (which you set in the other
tab in design mode) with that of acDialog forms.

The model setting is not controlled via code. You simply set this setting in
the "other" tab, and can then either open a form in via code, or simply by
clicking on it in the ms-access UI, and the model setting is RESPECTED!. In
fact, you CAN NOT control this setting via code for all intensive purposes.
And, you should be clear on the fact that opening a form in acDialog mode is
COMPLETELY a different issue, and different process from model forms.
(using the acDiglog option is rather nasty,a nd that option halts all code,
in including forms calling code...and you can't even use the built in menus
(in fact, you can't even use custom menus either. So, don't confuse acDialog
with model). An acDialog form is much like the MsgBox command, in that
nothing else can get, or have the focus until you dismiss that dialog. A
model form has NO such behaviors at all. A model form simply keeps the
focus, but your code continues to run (and custom menus etc. continue to
function as normal). And, the calling code that opened the model form
continues to run, and can even assign values etc. to the MODEL form!
However, that model form DOES keep the focus, and it has to be closed BEFORE
you are able to return to the previous form.

So, there is a huge difference, and huge reasons as to when, and not when to
use a acDialog form VS a model form. They are very different animals, and
thus while very few of my forms are acDialog, about 80-90% are model.

The use of the model setting is CRITICAL to program flow. If a form is set
to model, and it opens another form that is ALSO to model and so on, then
you will be forced to exit out the in the reverse order.

Likely what is happening is the first form is not set to model..and it
should be.

And, if it is set to model...it likely is also set to popup..and that should
NOT be the case!

I have a main popup form that is set to modal


A main form that is model makes sense...but no the fact that it is popup? (I
am now confused).

Just make the main form a regular form..and in the other tab set it to
model....

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.


This form that pops up should also be model...and you don't need it to be
popup. This form will keep the focus until the user closes it. The user
should NOT be able to get back to the main form until it is closed.

I suspect the issue here is the popup setting..as that setting gets confused
with a model setting (popup means to remain on top...and allow other forms
to open. It does NOT make sense to have a form that is popup and
model.........). A form when launched is always on top if it is model.
However, a form with a popup stetting STAYS on top EVEN when additional
forms are launched..and thus model don't make sense at all!

And, as mentioned, the above issues for the model setting are not to be
confused with acDialog forms (which can ONLY be set via the OpenForm
Method)..and should not be confused with popup, or model forms.

So, remove all popup settings...and just stick with model....


--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada

http://www.attcanada.net/~kallal.msn


  #4  
Old November 21st, 2004, 05:49 AM
AT
external usenet poster
 
Posts: n/a
Default

Wow, thanks for your thoughts. I will definately look at my modal and pop up
settings.

Thanks!

"Albert D. Kallal" wrote:

Of course, you realize that sub-form is just a control on the parent form.

So, when you set a form as model, then of course the sub-form being part of
the form is also model.

However, you do NOT want to confuse model forms (which you set in the other
tab in design mode) with that of acDialog forms.

The model setting is not controlled via code. You simply set this setting in
the "other" tab, and can then either open a form in via code, or simply by
clicking on it in the ms-access UI, and the model setting is RESPECTED!. In
fact, you CAN NOT control this setting via code for all intensive purposes.
And, you should be clear on the fact that opening a form in acDialog mode is
COMPLETELY a different issue, and different process from model forms.
(using the acDiglog option is rather nasty,a nd that option halts all code,
in including forms calling code...and you can't even use the built in menus
(in fact, you can't even use custom menus either. So, don't confuse acDialog
with model). An acDialog form is much like the MsgBox command, in that
nothing else can get, or have the focus until you dismiss that dialog. A
model form has NO such behaviors at all. A model form simply keeps the
focus, but your code continues to run (and custom menus etc. continue to
function as normal). And, the calling code that opened the model form
continues to run, and can even assign values etc. to the MODEL form!
However, that model form DOES keep the focus, and it has to be closed BEFORE
you are able to return to the previous form.

So, there is a huge difference, and huge reasons as to when, and not when to
use a acDialog form VS a model form. They are very different animals, and
thus while very few of my forms are acDialog, about 80-90% are model.

The use of the model setting is CRITICAL to program flow. If a form is set
to model, and it opens another form that is ALSO to model and so on, then
you will be forced to exit out the in the reverse order.

Likely what is happening is the first form is not set to model..and it
should be.

And, if it is set to model...it likely is also set to popup..and that should
NOT be the case!

I have a main popup form that is set to modal


A main form that is model makes sense...but no the fact that it is popup? (I
am now confused).

Just make the main form a regular form..and in the other tab set it to
model....

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.


This form that pops up should also be model...and you don't need it to be
popup. This form will keep the focus until the user closes it. The user
should NOT be able to get back to the main form until it is closed.

I suspect the issue here is the popup setting..as that setting gets confused
with a model setting (popup means to remain on top...and allow other forms
to open. It does NOT make sense to have a form that is popup and
model.........). A form when launched is always on top if it is model.
However, a form with a popup stetting STAYS on top EVEN when additional
forms are launched..and thus model don't make sense at all!

And, as mentioned, the above issues for the model setting are not to be
confused with acDialog forms (which can ONLY be set via the OpenForm
Method)..and should not be confused with popup, or model forms.

So, remove all popup settings...and just stick with model....


--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada

http://www.attcanada.net/~kallal.msn



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with Outlook 2000 after upgrading to Windows XP SP2 Corbin O'Reilly General Discussion 1 September 24th, 2004 07:19 PM
Why does Office 97 not work after installing Windows XP SP2? Lshaddix Setup, Installing & Configuration 4 September 13th, 2004 05:31 PM
A good spam software? Lloyd Hanning Outlook Express 6 July 19th, 2004 05:50 AM
Windows Search Tool Mark General Discussions 0 June 1st, 2004 09:24 PM


All times are GMT +1. The time now is 05:14 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.