Access 2003 Hide Form to trigger a DB On Close event

G

Guest

In previous versions of Access one was able to trigger a database OnClose
Event by having a form hidden in the background and coding the OnClose event
of the form to function like the OnClose Event of the database.

The problem is that Access 03 doesn't seem to let one do this anymore. I
can't get my form to be completely hidden. And when I close the DB it takes
precedence over the form closing so my code doesn't execute.

Anyone have ideas on how to create a pseudo OnClose event for a database in
03?
 
R

Rick Brandt

Pato-chan said:
In previous versions of Access one was able to trigger a database
OnClose Event by having a form hidden in the background and coding
the OnClose event of the form to function like the OnClose Event of
the database.

The problem is that Access 03 doesn't seem to let one do this
anymore. I can't get my form to be completely hidden. And when I
close the DB it takes precedence over the form closing so my code
doesn't execute.

Anyone have ideas on how to create a pseudo OnClose event for a
database in 03?

You have something else going on because this behavior has not changed in
Access 2003. The Close and Unload events of all (open) reports and forms
should fire when Access is closed.

How are you hiding your form? What do you mean when you say it is "not
completely hidden"?
 
G

Guest

Rick Brandt said:
You have something else going on because this behavior has not changed in
Access 2003. The Close and Unload events of all (open) reports and forms
should fire when Access is closed.

How are you hiding your form? What do you mean when you say it is "not
completely hidden"?
I figured out why my form was only partially hidden. I'm now using
DoCmd.OpenForm "InvisibleForm", , , , , acHidden to open the form as hidden.
But I still can't keep Access from closing on top of my PeopleInput form.
The code below executes but Access still closes. Am I doing something wrong?

Private Sub Form_Close()
' Open the form to get the # people worked
DoCmd.OpenForm "PeopleInput"
End Sub
 

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