By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,950 Members | 989 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,950 IT Pros & Developers. It's quick & easy.

How to close modal popup form from VBA

P: n/a
I have the following code in a button on my modal popup form

After the user enters the information, they click on a button. I want
the form to close after processing the information.

At the bottom of the button-click event, I have:
DoCmd.Close acForm, Me.Name

I get an error that says:
Run-time error 2585
This action can't be carried out while processing a form or
report event.

I'm not sure what this means because you would want it to close after
performing some event.

Please let me know how to fix this.

Thanx.
Oct 17 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a

Fred wrote:
I have the following code in a button on my modal popup form

After the user enters the information, they click on a button. I want
the form to close after processing the information.

At the bottom of the button-click event, I have:
DoCmd.Close acForm, Me.Name

I get an error that says:
Run-time error 2585
This action can't be carried out while processing a form or
report event.

I'm not sure what this means because you would want it to close after
performing some event.

Please let me know how to fix this.

Thanx.
Your post begs the question - what event is the form performing? You
must have some code somewhere that's still executing. Try putting a
DoEvents before the DoCmd.Close call.

Oct 17 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.