How to tell how if a form is opened in Dialog mode

J

Jasonm

Hi all,

I am using the following code in a comboboxes not in list event ot open a
form to complete a record entry for a new value added to the underlying data
table. This portion works fine, but I would like to rewrite the Closing
button code if the window was called from this event or from the
switchboard.

DoCmd.OpenForm stDocName, , , stLinkCriteria, , acDialog

I thought that I read that if the window mode was set to acDialog that it
would set the forms PoPup and Modal properties to TRUE. That doesn't seem to
be the case. Does anyone know how I can determine the opened mode of the
form I.E. Normal or otherwise...

Thanks-you very much in advance.

Jason M Canady
 
S

Stefan Hoffmann

hi,
I thought that I read that if the window mode was set to acDialog that it
would set the forms PoPup and Modal properties to TRUE. That doesn't seem to
be the case. Does anyone know how I can determine the opened mode of the
form I.E. Normal or otherwise...
Nope. You can't determine the open mode.

Use the OpenArgs parameter instead:

DoCmd.OpenForm stDocName, , , stLinkCriteria, , acDialog, "NOTINLIST"

You can query the parameter in your form: If OpenArgs = "NOTINLIST" Then ...


mfG
--> stefan <--
 
J

Jasonm

Thanks, I'll give that a try...

It is frustrating though as since posting I have re-read the sections on
opening the form in acDialog and it clearly says that it sets both the Modal
and PopUp Properties to YES!

Thanks for your suggestion,

Jasonm
 

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