Cannot close a form in a MACRO

G

Guest

Using a form that calls a macro to do edit checks. When all the checks are
OK I provide a message to the user through a MsgBox. When they click OK the
next step in the macro is to "Close the Form". It will not close and I get
an error message the it cannot close when a form in processing - "some field
has an event that is triggered OnOpen, OnClose,OnRetreat,On Page, or OnPrint.

You can close the form with the close button or with File, close.
I have also created a simple two field form in which the second field call a
macro that only has a Close form action and it fails.
Any ideas or solutions?
 
G

Guest

I am using the "OnEnter" event on a command button, which is the last tab
stop on the form.

Thanks for the quick reply and any help you can give.
 
T

Tom Lake

GeorgieGirl said:
I am using the "OnEnter" event on a command button, which is the last tab
stop on the form.

Try calling the macro from the OnClick event so the form will only close
when you click the button, not when the cursor arrives at it.

Tom Lake
 
G

Guest

I have the same problem using the Lost Focus Event in the last text box on my
form in the Details Section (I have other text boxes in the Form Footer).
The macro has two items. The first sets the value of a field in another form
(which works), and the second is meant to close the form. I don't really
want to do anything other than just leave the field to close the form, as
sometime this field will not be changed. Any suggestions?
 

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