Form close itself?

  • Thread starter Thread starter SirPoonga
  • Start date Start date
S

SirPoonga

Can I have a form close itself at the end of a function? Like if I
make a close button?
I tried Unload Me but that produced an error.
 
Can I have a form close itself at the end of a function? Like if I
make a close button?
I tried Unload Me but that produced an error.

this is VB

in Access: docmd.close acform, Me.name
 
At the end of the code for the button, you can use:

Docmd.Close acForm, Me.Name

Trying to close something while Unloading it is too late. The close is
already in motion, so telling it to close again doesn't do anything
productive.
 
Can I have a form close itself at the end of a function? Like if I
make a close button?
I tried Unload Me but that produced an error.

The syntax is

DoCmd.Close acForm, Me.Name

John W. Vinson[MVP]
 

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

Back
Top