Need help with Modal Popup

B

Bob Howard

My user terminates the aplication by clicking a button on the main form's
screen. In my onclick event for that button, and just before I actually
terminate the application by closing the main form, I display another little
form to confirm some ending status information with the user.

That little form has its Border Style set to Dialog, and both its Modal and
Popup properties are set to Yes.

So I issue an openform for the little form ... and I see it briefly flash on
the screen ... and then the application terminates on its own!

I stuck a msgbox in the onopen event for the little form just to make sure I
was getting there correctly, and I am. When I click "go" in the msgbox,
then the little form flashes and the whole thing goes away.

I thought with a dialog (modal popup), all other processing is supposed to
wait for the dialog to complete.

Am I wrong about that???

Bob (@Martureo.Org)
 
T

tina

in the OpenForm command, set the WindowMode argument to acDialog, as

DoCmd.OpenForm "MyFormName", , , , , acDialog

include any of the other arguments you need, of course.

hth
 
B

Bob Howard

You did it again!

I was aware of that option, but thought it only would override settings that
were set in the little form's design --- and since there were set properly
in the little form's design, the acDialog wouldn't make a difference.

Clearly, I was wrong!

I guess I can see the logic involved, however. The VBA in the calling form
would have to wait until the called form actually completed loading in order
to know whether to continue processing or wait at that point. And for
calling a non-dialog form that would result in a performance impact.

Thanks for the help!...

Bob.
 
T

tina

you're welcome, Bob! one of the many, many little tricks i've learned here
in the newsgroups - it really pay to lurk. <g>
 
A

Albert D.Kallal

Bob Howard said:
You did it again!

I was aware of that option, but thought it only would override settings
that
were set in the little form's design --- and since there were set properly
in the little form's design, the acDialog wouldn't make a difference.

As an interesting note, a model form is VERY different from a dialog form.
Model forms do NOT halt code in any way..where as a dialog form is rather
nasty..and does halt calling code.

You can read about his here:

http://www.members.shaw.ca/AlbertKallal/Dialog/Index.html
 
B

Bob Howard

Thank you! I read your article and it was very helpful. All the processing
I needed to perform I accomplish in the dialog form, so I simply close that
form in an OnClick event.

My confusion was not so much on the modal issue, but on the acDialog issue.
In that forms definition, I defined its Border Style as Dialog and I figured
that would be all I needed to do to make the form itself a dialog.

WRONG!

With Tina's help (and ytour followup) I now see that I must OPEN it as
dialog (regardless of the border style).

Thanks again!

Bob.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Trouble maximizing a modal popup 3
Popup/Modal Problems 2
Form slow to repaint after closing modal dialog 0
modal windows 3
Modal Popup flash 3
modal question 1
Resizing Popup/Modal forms 3
System Modal 1

Top