Closing a form and returning to original error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
Basically I have 5 forms open, FormB and RostYA1 to RostYA4. Now when I
reach RostYA4 I need to close all forms except FormB. When using docmd.close
acform, name, acsaveno it closes all the forms I want except RostYA4 (Which
I'm currently in)
I have tried to use Forms!FormB.SetFocus and DoCmd.OpenForm "FormB" etc...
but I still get an error saying "This action can't be carried out while
processing a form or report event"
AAAAHHHHH.... driving me insane... after all, all I want to do is close that
form and return to the original one - "FormB"
Please Help :(
 
after all of the forms have closed you can reopen the form, again, just befor
you have shut the last bit of code
 
I have tried everything but to no avail...Do you mean the following?

DoCmd.Close acForm, "RostYA3"
DoCmd.Close acForm, "RostYA2"
DoCmd.Close acForm, "RostYA"
DoCmd.OpenForm "FormB"
DoCmd.Close acForm, "RostYA4"

Still gives me the same error...
 
Hi Justin

I'm a relative novice but thought I'd put in my 2c worth!

Have you tried putting the DoCmd.Open line of your code after all the close
ones? eg,
DoCmd.Close acForm, "RostYA3"
DoCmd.Close acForm, "RostYA2"
DoCmd.Close acForm, "RostYA"
DoCmd.Close acForm, "RostYA4"
DoCmd.OpenForm "FormB", acNormal, etc...

If you need it to open to the record you had open last, I know there is some
way to do it but not off the top of my head. There's heaps of info on that in
this forum if you search.

HTH

Cindy
 

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

Back
Top