468,321 Members | 1,811 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,321 developers. It's quick & easy.

Make Form Button close current form and bring switchboard to foreground

Hi,

Can anyone recommend a piece of VBA code I could attach to a button in
a MS Form form that will close the current form and bring the
switchboard to foreground. I'm trying to integrate a form of buttons
into the way the switchboard gets used.

Best wishes,

George Hadley
gh********@yahoo.com

Mar 13 '06 #1
4 9237
<gh********@yahoo.com> wrote in message
news:11**********************@p10g2000cwp.googlegr oups.com...
Hi,

Can anyone recommend a piece of VBA code I could attach to a button in
a MS Form form that will close the current form and bring the
switchboard to foreground. I'm trying to integrate a form of buttons
into the way the switchboard gets used.

Best wishes,

George Hadley
gh********@yahoo.com


George,

You don't really need a "close form" button. Hide your switchboard form
when your
target form opens and unhide it when it closes. In the target form's open
event:

Forms("frmSwitchboard").Visible = False

In the form's close event:

Forms("frmSwitchboard").Visible = True

It's a bit clunky in that it will cause an error if the switchboard form
isn't loaded but it should work otherwise.

Keith.
www.keithwilby.com
Mar 13 '06 #2
Form_frmSwitchboard.Visible = False/True
should avoid the error and open the form if it is not loaded (and not
open it if it is).
This assumes frmSwitchboard's HasModule Property is True. I assume it
will be True for a Switchboard.

Mar 13 '06 #3
"Lyle Fairfield" <ly***********@aim.com> wrote in message
news:11**********************@z34g2000cwc.googlegr oups.com...
Form_frmSwitchboard.Visible = False/True
should avoid the error and open the form if it is not loaded (and not
open it if it is).
This assumes frmSwitchboard's HasModule Property is True. I assume it
will be True for a Switchboard.


Didn't realise that Lyle, thanks for the info.

Keith.
Mar 13 '06 #4
gh********@yahoo.com wrote:
Hi,

Can anyone recommend a piece of VBA code I could attach to a button in
a MS Form form that will close the current form and bring the
switchboard to foreground. I'm trying to integrate a form of buttons
into the way the switchboard gets used.

Best wishes,

George Hadley
gh********@yahoo.com


To close the current form you can enter something like
Docmd.Close acForm,Me.Name
and to select the Switchboard
Docmd.SelectObject acForm,"SwitchboardFormName"

Mar 13 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Eric Osman | last post: by
13 posts views Thread by Martin Dennett | last post: by
2 posts views Thread by Lumpierbritches | last post: by
8 posts views Thread by Emily Jones | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.