For a project running Access 2003, I have a form that is usually installed modeless, but in some cases opens as acDialog and, therefore, modal.
Now this form should check whether the modal itself is or not to change its behavior when the button is clicked.
Me.Form.Modal
returns the property value specified in design mode, and not the current state.
I found a similar answer for VB that suggests using the GetWindowLong API call for "user", but that does not translate to VBA (Microsoft KnowledgeBase 77316), I am afraid: Access2003 cannot find the "user" file.
In short: Is there a reliable way to determine if the form itself is modal or non-modal from within this form?
TIA.
Edit: It seems I remember that Me.Form is actually equivalent only to me. As far as I remember, the Form property is standard, so if you omit it, it is assumed. No matter how Me.Modal and Me.Form.Modal pass false, regardless of how the form is opened.
p122 source
share