How to hide and unhide forms?
Posted on 2012-09-06
I have a form used as a switchboard. Buttons on it to open several forms. To open a form, I use me.invisible=false then call the opening of the designated form with docmd.openform.... and pass me.name in the openargs.
When I am finished with the opened form, I want to close it or hide it and make the switchboard visible again. Which I do currently in the on click event of the forms close form button by making the currently open form hidden with me.visible=false and calling forms (me.openargs).visible, which hides the open form and shows the switchboard form. If I click on the switchboard button to reopen the same form as before, it does not open maximized since the onopen event does not trigger. Ideally I would like to close the second form and unhide the switchboad from the unload event. However if I put a docmd.close in the forms close form onclick event, it makes the openargs null and throws an error if I use forms (me.openargs).visible in the forms unload event.
What is the best way to handle this?