Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / March 2006

Tip: Looking for answers? Try searching our database.

Make Form Button close current form and bring switchboard to foreground

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ghadley_00@yahoo.com - 13 Mar 2006 13:23 GMT
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"
   
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.