Form Closing.

C

CEL504

I have read a few of the questions and answers in the forum regarding this,
but to be honest, I have lost the plot with it.
If I have a switcboard form, from where I navigate to the other forms, how
do I close the previous form?
Say I go from the switchboard to say to the main input form, then back to
the switchboard again. Where would I write the code to tell me to close the
main input form?

As ever any help is gradly received and appreciated. Many thanks.

Cel504
 
J

Jeanette Cunningham

Have a button to open the second form.

Private Sub cmdOpenForm2_Click9)
DoCmd.OpenForm "Form2"
DoCmd.Close acForm, Me.Name
End Sub


The above code will open form2 then close the switchboard.


Have a button to close form2 and return to the switchboard

Private Sub cmdOpenSwitchboard_Click()
DoCmd.OpenForm "FormSwitchboard"
DoCmd.Close acForm, Me.Name
End Sub


Note: replace Form2 and FormSwitchboard with the names of your forms.
Replace cmdOpenForm2 and cmdOpenSwitchboard with the names of your buttons.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 

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