Unloading a form?

  • Thread starter Thread starter Dennis
  • Start date Start date
D

Dennis

I created a form in Access (2002). This form has a couple
of text fields and a couple of command buttons. One of
those buttons is labelled EXIT. It's my intention to
UNLOAD the form (thus terminating the program) upon the
event-click for the EXIT button.

When I go to the code-view for the event, I haev a "blank"
sub. I try to place "UNLOAD myForm" in the sub, but I get
an error when I click the button. "myForm" matches the
name of the form as defined. I've even attempted
using "forms(0)" as well as Forms("myForm")to no avail.

Any assistance would be greatly appreciated.

Thanks!

Dennis
 
Dennis said:
I created a form in Access (2002). This form has a couple
of text fields and a couple of command buttons. One of
those buttons is labelled EXIT. It's my intention to
UNLOAD the form (thus terminating the program) upon the
event-click for the EXIT button.

When I go to the code-view for the event, I haev a "blank"
sub. I try to place "UNLOAD myForm" in the sub, but I get
an error when I click the button. "myForm" matches the
name of the form as defined. I've even attempted
using "forms(0)" as well as Forms("myForm")to no avail.

Any assistance would be greatly appreciated.

Thanks!

Dennis

Is it your intention to close the Access application as well as the
form? If so, then you have to do more than just close the form. You
can write

DoCmd.Quit

in the button's Click event procedure.
 

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

Similar Threads


Back
Top