Modal blues

M

mrwillj49

Hi,

I have a modal form and I used to use an InputBox to get some input from
the user on this form and it worked fine. Now I've created a custom form
that will replace the InputBox function. I like it better because I can set
maximum length for entries and accurately detect if cancel was pressed on it.
Unfortunately I am unable to use my CustomInputBox form in place of InputBox
because I get an error on the call to DoCmd.openForm due to the fact that I
am already on a modal form. Is there any way to open another modal form on
top of an existing open modal form?

Thanks,
Will
 
R

Rick Brandt

mrwillj49 said:
Hi,

I have a modal form and I used to use an InputBox to get some input
from the user on this form and it worked fine. Now I've created a
custom form that will replace the InputBox function. I like it
better because I can set maximum length for entries and accurately
detect if cancel was pressed on it. Unfortunately I am unable to use
my CustomInputBox form in place of InputBox because I get an error on
the call to DoCmd.openForm due to the fact that I am already on a
modal form. Is there any way to open another modal form on top of an
existing open modal form?

Thanks,
Will

That should not be a problem, but I suspect that you actually need a form
opened with acDialog rather than just a modal form.

A form opened with the acDialog option behaves as a modal form, but it ALSO
causes the code block that opened it to pause until the form is closed or
hidden. Simply opening a modal form does not provide this code-pausing
feature and when you are prompting the user for input you would usually need
that.
 
A

Albert D. Kallal

There is little, if any reason why a model form can't call another model
form......

You might want to post your docmd.Openform line of code, but it should work
just fine......

further, are you confusing model with dialog?

I explain the difference here:

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

Regardless, a dialog form can open anther dialog form, and so can a model
form....

Do note however that model forms when opened do NOT halt the calling code.
So, in the case of the msgbox command, that halted code until you answer the
msgbox, or inputbox command, and then the code would continue. A model form
does NOT wait, and does NOT halt the calling code. A dialog form DOES halt
the calling code, but the user *usually* closes the form to continue, and
thus the values of that form are not available (unless you read my above
article that explains how to do this).
 

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