Closing a form?

  • Thread starter Thread starter Linn Kubler
  • Start date Start date
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
 
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
 
Back
Top