Closing forms, help please.



Could someone give me some advice please. I have a switchboard form in my
database and from here I move to other forms and then return to the
switchboard after reviewing, how do I get the forms to close when I return to
the switchboard again? I have read a few of the threads, yet still can't get
my head around it at the moment. Any advice would be greatly appreciated.

Rob Parker

Did you see this reply I posted to your previous post of this same question
a few days ago?

If you're really wanting to control the user interface to prevent people
from having lots of different forms open at the same time - due to the
switchboard form being always available - then the easiest way is to hide
(rather than close) the switchboard form when another form is opened, and
show it again when the other form is closed. To do this, you'd use code
such as this:

In the event of the button on the switchboard form to open the new form:
Me.Visible = False
DoCmd.OpenForm "frmNewFormName"

In the close event of frmNewFormName:
Forms("frmSwitchboard").Visible = True
Putting this code in the Close event of the form ensures that it will always
run, regardless of how the user closes the form. If you've set up your form
(and menus) so that the user can only close the form via a command button
you have supplied, then you can put this code in the Click event of your
close button.



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

Similar Threads