Help with Switchboard

  • Thread starter Uschi via AccessMonster.com
  • Start date
U

Uschi via AccessMonster.com

I am making a database for a non-profit organization. I decided to forego the
Switchboard Manager this time and make my own Switchboard. At this time, my
Switchboard contains 4 pages. What I would like to do is have a page close
when a new page is opened from any of the command buttons so there is only 1
page opened at a time.

Currently, the Main Switchboard has 2 command buttons that open up pages. I
have only had success with one command button (the first one). When I use the
same code on the second command button it comes back with an error message. I
used the code:

DoCmd.Close acForm, "Switchboard"

My pages are as follows:

Switchboard
Branch of Armed Forces
Ethnicity and Gender
Reports

I would appreciate help with this.

Thank you,
Uschi
 
S

strive4peace

Hi Uschi,

Instead of specifying the form to close like this:
DoCmd.Close acForm, "Switchboard"

close whatever form you are behind, like this:
DoCmd.Close acForm, Me.Name

you will want to open the next form before you issue the Close statement

DoCmd.OpenForm "FormName to Open"
DoCmd.Close acForm, Me.Name

Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
:) have an awesome day :)
*
 
T

Tom van Stiphout

On Thu, 22 Jan 2009 22:33:28 GMT, "Uschi via AccessMonster.com"

It's not too late to go back to an approach that works and which you
are familiar with.

If you continue down the current path, you need to at least tell us
what error you got ("an error message" is too vague), and show us the
code.

-Tom.
Microsoft Access MVP
 
U

Uschi via AccessMonster.com

strive4peace said:
Hi Uschi,

Instead of specifying the form to close like this:
DoCmd.Close acForm, "Switchboard"

close whatever form you are behind, like this:
DoCmd.Close acForm, Me.Name

Crystal,

Thanks so much! Each is now closing as a new form is opened. I love the
creativity this method has over using the Switchboard Manager.

I have a new problem with a macro by closing my forms this way but I will
start a new thread.

Again, thank you,
Uschi
 
U

Uschi via AccessMonster.com

Tom said:
It's not too late to go back to an approach that works and which you
are familiar with.
Just wanted to let you know that I found out what I was doing wrong when
trying to insert a bit of code. You are very right - next time I will be sure
to note the error message. Details make a big difference.

Many thanks for quick reply,
Uschi
 

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