Close on Lost Focus

  • Thread starter Thread starter alex
  • Start date Start date
A

alex

Close on Lost Focus

Hello,

I have a pop up/modal form that opens on top of another form/subform.
I need this form to be modal, but, because it’s in ds view the modal
property does not work (continuous forms would be a pain...).

When the pop up opens, the title bar is blue (which I assume is
indicative to having focus). As a workaround to the modal issue, when
the title bar turns grey (pop up loses focus; e.g., user clicks
outside the form) I want it to close.

I can’t seem to code it, however; i.e., on lost focus will not close
the form!

Suggestions…

Thanks,
alex
 
Try using acDialog mode.
The code that opens the form would be something like this
DoCmd.OpenForm "FormName", , , "[ID] = " & Me.[ID], , acDialog

Put a close button on the form
DoCmd.Close acForm, Me.Name

Once the popup has opened, all other forms stop until user closes the popup
form.
As soon as user clicks the close button on the popup it closes and code on
the next active form will run.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia



Close on Lost Focus

Hello,

I have a pop up/modal form that opens on top of another form/subform.
I need this form to be modal, but, because it’s in ds view the modal
property does not work (continuous forms would be a pain...).

When the pop up opens, the title bar is blue (which I assume is
indicative to having focus). As a workaround to the modal issue, when
the title bar turns grey (pop up loses focus; e.g., user clicks
outside the form) I want it to close.

I can’t seem to code it, however; i.e., on lost focus will not close
the form!

Suggestions…

Thanks,
alex
 
Try using acDialog mode.
The code that opens the form would be something like this
DoCmd.OpenForm "FormName", , , "[ID] = " & Me.[ID], , acDialog

Put a close button on the form
DoCmd.Close acForm, Me.Name

Once the popup has opened, all other forms stop until user closes the popup
form.
As soon as user clicks the close button on the popup it closes and code on
the next active form will run.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia


Close on Lost Focus

Hello,

I have a pop up/modal form that opens on top of another form/subform.
I need this form to be modal, but, because it’s in ds view the modal
property does not work (continuous forms would be a pain...).

When the pop up opens, the title bar is blue (which I assume is
indicative to having focus).  As a workaround to the modal issue, when
the title bar turns grey (pop up loses focus; e.g., user clicks
outside the form) I want it to close.

I can’t seem to code it, however; i.e., on lost focus will not close
the form!

Suggestions…

Thanks,
alex

Jeanette,
acDialog did the trick...that's all I needed to do!
Thanks for the help,
alex
 
Back
Top