How to tell if form in dialog window mode

C

ctyrrell

Is there any way that code behind a form can tell if the form has been
opened in dialog windowmode?

I have a form that is usually opened not in dialog mode and it has
certain controls that open other forms. Normally this is fine. However,
there are occasions when the form is opened with an acdialog windowmode
and I would like to be able to detect this and respond differently in
the event handlers of those controls when the form is in dialog mode.

Does anyone know how to do this?

TIA,
Christine
 
S

Stefan Hoffmann

hi,

(e-mail address removed):
Is there any way that code behind a form can tell if the form has been
opened in dialog windowmode?
AFAIK no.

Sometimes i use the OpenArgs parameter to control different form behaviour.


mfG
--> stefan <--
 
W

Wayne Morgan

I don't know a way to detect it, but there is a way to tell the form. When
you open the form in Dialog mode, you could also include an OpenArgs
parameter in the DoCmd.OpenForm statement. In the form's code, you could
check for this OpenArgs parameter and adjust accordingly.
 
G

Guest

You can tell whether a form is a dialog by checking the Modal property:

If Me.Modal = True Then
'Do Stuff for Dialog version
Else
'Do Stuff for regular unleaded version
End If
 
S

stefan hoffmann

hi,
You can tell whether a form is a dialog by checking the Modal property:
If Me.Modal = True Then
'Do Stuff for Dialog version
Else
'Do Stuff for regular unleaded version
End If

This is only true, if the Modal property is set in the design view or at
runtime.

The DoCmd.OpenForm optional parameter WindowMode As AcWindowMode
(acDialog and acWindowNormal) won't change this property.


mfG
--> stefan <--
 

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