Can't unload a form

B

Ben

Hi all,

I have a form with the Timer event set to certain intervals. Within the
form, I have an IF statement to check for a condition, once the condition is
met I would like to unload the form. I tried to unload the form using:
Unload me and unload form_FrmName. Both syntax failed. The error message
is:

run-time error '361':
can't load or unload this object.

any ideas? Thanks.

Ben
 
A

Allen Browne

Try:
DoCmd.Close acForm, Me.Name

Check to see if the form is Dirty before closing it.
 
B

Ben

Allen,

It worked great. But I am not sure why the simple unload wouldn't work.
How does the DoCmd syntax below differ or act differently than the simple
unload statement? I am trying to understand how and when I would use that as
oppose to the unload statement and why I would use it over unload statements.
Thanks again.

Ben
 
A

Allen Browne

Access forms are a different kind of critter than VB forms. The Close method
is the standard way of closing a form or report in Access.
 

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