T
Tim
Hello,
I have a form with a command button which open a smaller
form. The second (smaller) form has a close button on it
which of course closes the form. I would also like the
second form to close if the user clicks anywhere outside
the smaller form. So, if the user clicks anywhere in the
first (larger) form the smaller form closes. I know that
the command
Docmd.Close acForm, "smaller form",acSaveYes
will do it if I place this command in the onclick event of
a field on the larger form. However, I don't want to
place this code in every field of the larger form.
Where do "on deactivate" or "on lost focus" or any other
event come into play? I tried placing a Docmd.Close
command in these events for the smaller form, but it
didn't work. I also tried to place the above command in
the "on got focus" and "on active" events of the larger
form.
Is there no way to do this?
Thanks in advance
Tim
I have a form with a command button which open a smaller
form. The second (smaller) form has a close button on it
which of course closes the form. I would also like the
second form to close if the user clicks anywhere outside
the smaller form. So, if the user clicks anywhere in the
first (larger) form the smaller form closes. I know that
the command
Docmd.Close acForm, "smaller form",acSaveYes
will do it if I place this command in the onclick event of
a field on the larger form. However, I don't want to
place this code in every field of the larger form.
Where do "on deactivate" or "on lost focus" or any other
event come into play? I tried placing a Docmd.Close
command in these events for the smaller form, but it
didn't work. I also tried to place the above command in
the "on got focus" and "on active" events of the larger
form.
Is there no way to do this?
Thanks in advance
Tim