Form Closing.

  • Thread starter Thread starter CEL504
  • Start date Start date
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
 
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
 
Back
Top