Close versus Unload, etc.

G

Guest

In Office 2003, there are certain points in my code where I "close" a form,
report, etc. using a DoCmd. Should I be using "unload" instead?

Is there an important difference when dismissing the object apart from
trapping the event for some special purpose?

i.e. Is there any performance or memory gain/advantage to one over the
other? Should they be used together in any particular sequence?

What is considered the cleanest way to close an object?

Thanks again for everyone's input.
 
R

Rick Brandt

XP said:
In Office 2003, there are certain points in my code where I "close" a form,
report, etc. using a DoCmd. Should I be using "unload" instead?

Is there an important difference when dismissing the object apart from
trapping the event for some special purpose?

i.e. Is there any performance or memory gain/advantage to one over the
other? Should they be used together in any particular sequence?

What is considered the cleanest way to close an object?

Thanks again for everyone's input.

Don't confuse methods with events. While a form has both a Close event and an
Unload event you can only destroy a form by closing it. There is no
DoCmd.UnloadForm.
 
G

Guest

Rick is correct. There is an UnLoad statement in VBA, but it really doesn't
apply to Access forms as the Help example would lead you to believe.
 

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