Make switchboard close

R

R. Choate

I created a form which I want to open when I click a button on my switchboard. Easy enough. I set the command to open a form and the
argument to the form's name.

When I do that, though, the switchboard stays open. I would be satisfied if I could minimize the thing, but I would prefer that it
close. That form does other things the switchboard can't do, but it does have a button I put on it to re-open the switchboard. I
would think that Access should allow us to have more than one command for a click on a command button.

Any ideas?
 
R

R. Choate

Addendum to my post:

I read other posts on switchboard customizing and saw suggestions about going to design view and then changing the click event for
the button which is the root of my problem. I tried changing the event away from "=HandleButtonClick(6)" and making it just run a
procedure. That solution caused problems when that same button is used for something else on a different switchboard page. I'm
guessing this is still related to the eventual solution I need.

Thanks !
--
RMC,CPA


I created a form which I want to open when I click a button on my switchboard. Easy enough. I set the command to open a form and the
argument to the form's name.

When I do that, though, the switchboard stays open. I would be satisfied if I could minimize the thing, but I would prefer that it
close. That form does other things the switchboard can't do, but it does have a button I put on it to re-open the switchboard. I
would think that Access should allow us to have more than one command for a click on a command button.

Any ideas?
 
G

Guest

The real solution is to ditch the switchboard and create your own "Menu"
form. Then you can do whatever you want. The switchboard is really
"training wheels", that is it is convenient for inexperienced developers or
the casual user, but, as you have seen, becomes cumbersome when you want to
move beyond the basics.
You will find there are two things most professionals do not use -
Switchboards and Macros.
 
J

jrmask via AccessMonster.com

In the Deactivate event of the form (switchboard) you want to minimize or
close
DoCmd.Minimize or
DoCmd.Close

Instead of closing and using a button to re-open the swithboard you could
leave the switchboard minimized and place code in the second form to restore
the first switchboard.

Use the Close event of the second form and set the focus back to the
minimized switchboard.

Forms!YourSwitchboardform.SetFocus and then on the first switchboard place
code using the Activate event of DoCmd.Restore, this will bring you back to
the first switchboard seamlessly.
 
R

R. Choate

Hi Dave,

I agree with your comments even though I thought switchboards were still used but not built with the wizard. I never use macros. I
know there are a bunch of addtl items on that list as well. However, I can't devote the time to go from scratch on this one. I'm
doing someone a favor on this to begin with. I also tried the other suggestion someone sent but apparently the deactivate event
didn't fire. I tried putting the docmd.close in the on lost focus event as well and that didn't work either. Twilight zone here.

--
RMC,CPA


The real solution is to ditch the switchboard and create your own "Menu"
form. Then you can do whatever you want. The switchboard is really
"training wheels", that is it is convenient for inexperienced developers or
the casual user, but, as you have seen, becomes cumbersome when you want to
move beyond the basics.
You will find there are two things most professionals do not use -
Switchboards and Macros.
 
L

Larry Linson

R. Choate said:
Hi Dave,

I agree with your comments even though I thought switchboards were still
used but not built with the wizard. I never use macros. I
know there are a bunch of addtl items on that list as well. However, I
can't devote the time to go from scratch on this one. I'm
doing someone a favor on this to begin with. I also tried the other
suggestion someone sent but apparently the deactivate event
didn't fire. I tried putting the docmd.close in the on lost focus event as
well and that didn't work either. Twilight zone here.

Switchboards are definitely still used, but the Switchboard Manager is a
complex solution to a simple problem, and does not easily lend itself to
customization. Creating your own switchboard (or menu form if you prefer
that "view") is simple, straightforward, and doesn't restrict your
creativity. You can collect criteria directly from the menu form, execute
as much code from the click event as you wish, use something other than
Comand Buttons -- often you will see a ComboBox from which the user chooses
a Report from a list, and open and close at will without concern as to
repositioning within the file that drives the switchboard hierarchy
(because, if you are smart, there won't be such a file -- that's where the
"complex" really comes into play in my statement above).

Larry Linson
Microsoft Access MVP
 

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