question of form modal property

J

Jason Jiang

I want to open a form as modal. When I use this way, it suspend the calling
sub.

"docmd.openform formName,,,,,acDialog", Which is very good.

But when I want to open the form as class, The calling sub could be suspend.
Like this

dim Myform as new Form_ProductSelector
Myform.modal = true
Myform.show

The Form "ProductSelector"'s modal and popup property are set to "True" for
sure.
Anybody can tell me why?

Thank you very much!

Jason
 
A

Albert D. Kallal

The Form "ProductSelector"'s modal and popup property are set to "True"
for sure.
Anybody can tell me why?

model and dialog settings are COMPLETE 100% unrelated to each other. We
talking apples and orange.

A model form is not a dialog form. Grand canyon of difference. That is
why....

I explain the difference here:

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


When you launch a model form via code, it NEVER did halt the call routines.
So, a model form is complete huge large diffent then that of a acDialog
form.

A dialog form is like a msgbox command, all focus remains on that dialog
(and you can't even use custom menus, or anything else). Were as model
forms...you can open more then one in succession in code...it does not halt
code. So, acdialg and model forms are HUGE MASSIVE LARGE different kinds of
forms.

A model form is used to control the flow of the users path. Thus, if you
have a customer form, and the open a invoice form, if you make them
model..the user will have to close the invoice form and traverse back the
same way they came. I would say that a fairly large portion of my forms are
model. Dialog forms also force this traversing back, but the purpose of
dialog forms is just that...it is a dialog like a msg dialog box and NOTHING
else can have the focus,a nd calling code halts. Hardly a modern user
interface in a windows environment in which users are supposed to have a
flexible UI.

You can't open a class instance of a form in dialog mode. Thus, if you need
to pass, or retrieve values from that form, a good approach is to simply set
a references back to the calling form, or better even to create a class
object in which to pass the values back.
 
J

Jason Jiang

Dear Albert

Again, thank you again. You help my out of this problem confused me for many
years -_-!!. I guess it's because the HELP in access is so blur. And you
also help me out for a good way to build a Form Function.

Thank you !!!a lot a lot!!!

With best regards

Jason
 

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

Top