Closing a form?

L

Linn Kubler

Hi,

I'm trying to create a button on a form that closes the form when you click
it. However, I can't seem to get it to work. From what I can tell I should
be able to put one of these commands in my onclick event for the button:

unload me
unload forms!myform

Neither work, both give an error stating the form can't be closed. It says
I can't load or unload this object.

This can't be this difficult can it? Anyone know what I'm missing here?
It's Access 2002.

Thanks in advance,
Linn
 
S

Steve Schapel

Linn,

If you want to use a macro, the applicable action is Close. Make and
save a macro with the Close action, and asign the macro on the On Click
event property of your command button.

To use a VBA procedure, do it like this...
DoCmd.Close acForm, Me.Name
 

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