VBA to close form and bring switchboard to foreground

G

ghadley_00

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
[email protected]
 
A

Alex Dybenko

Hi,
something like this:

docmd.close acform, screen.activeform.name
docmd.openform "frmSwitchboard"
 
A

Allen Browne

After the 2 lines Alex suggested, you might want to add:
Forms("frmSwitchboard").SetFocus

That should handle the case where the switchboard is already open in the
background.
 
Top