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
ghadley_00@yahoo.com
Keith Wilby - 13 Mar 2006 14:13 GMT
> Hi,
>
[quoted text clipped - 7 lines]
> George Hadley
> ghadley_00@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
Lyle Fairfield - 13 Mar 2006 14:31 GMT
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.
Keith Wilby - 13 Mar 2006 14:45 GMT
> 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.
salad - 13 Mar 2006 16:17 GMT
> Hi,
>
[quoted text clipped - 7 lines]
> George Hadley
> ghadley_00@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"