Form Onopen, OnClose?

G

Golfinray

I am a little confused. I open forms with command buttons on a menu form I
wrote. I used DoCmd.openform commands to open the forms. When they select a
form on the menu, I would like the menu to close and when they finish with
the form I would like the menu to re-open. Do I put code on the onopen and
onclose lines and do I use DoCmd or is there a better method? Thanks!!!!
 
D

Daniel Pineault

1st don't contiuously open and close the menu. Simply hide/unhide it.

2nd, in the code that you use to open the form (from your menu) add code to
hide the menu and add in the form's onclose event code to unhide the menu.
 
F

fredg

I am a little confused. I open forms with command buttons on a menu form I
wrote. I used DoCmd.openform commands to open the forms. When they select a
form on the menu, I would like the menu to close and when they finish with
the form I would like the menu to re-open. Do I put code on the onopen and
onclose lines and do I use DoCmd or is there a better method? Thanks!!!!

One way is like this.
Code the Switchboard event:

DoCmd.OpenForm "FormName"
Me.Visible = false

Code the form's close event:

Forms!SwitchboardFormName.Visible = true
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top