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.
 
Back
Top