Form Lost Focus

M

Mary Fetsch

In Access 2000, I have a Patient form and a Doctor form. The Patient form
can be opened from the Doctor form, as well as from other forms. I would
like to require the user to close the Patient form before moving out of it,
or at least display a message when if the user doesn't close the form. I
can't check for this in another form because I don't know just which form
the user will move to.

The Patient form may not be updated, so I can't use a Before_Update event.
The form's Lost Focus event doesn't fire because I have controls on the
form. I know I can open the Patient form as a modal form, but I'd rather
not do that.

So my question boils down to this: As the focus leaves a form, is there a
way to identify whether or not the form was closed?
 
M

MikeC

Mary,

You will probably want to set the form's Modal property = Yes. This
property is locating on the "Other" tab in the form's property sheet. A
"Yes" setting will force the user to close the form before performing other
activities in the database.
 
M

Mary Fetsch

Thanks for your response, Mike. I said in my post that I didn't want to
open it as a modal form. Is there any other way?
 
M

Mary Fetsch

Thanks again for your response - I really appreciate your time. I already
have some code similar to what you suggested to check if a form's loaded. I
don't think I'll worry about closing the form when it loses focus, but
before it's called from another form, I'll check if it's loaded - if so,
I'll close it before opening it again. That way, variables, etc will be
initialized.
 

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