Closing Form with VBA Code

F

Frank Wagner

As the last step in a VBA procedure triggered by a form
event, I would like to close the form. When I place the
command "DoCmd.Close" in the procedure, I get error
message 2585 - - "this action can't be carried out while
processing a form event"

Is there any way around this so I can automatically close
the form?

Any help would be appreciated

Frank Wagner
 
R

Rick Brandt

Frank Wagner said:
As the last step in a VBA procedure triggered by a form
event, I would like to close the form. When I place the
command "DoCmd.Close" in the procedure, I get error
message 2585 - - "this action can't be carried out while
processing a form event"

Is there any way around this so I can automatically close
the form?

Any help would be appreciated

Frank Wagner

Depends on the event. Which one are you using? In most events it should work
fine.
 
G

Guest

The event is "On Exit" from a text box, and the code
would come right after the user answers yes to a message
box notification.
 

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