I want to write a piece of code that will close any form apart from the current form.The following code doesn't work the way I want. Basically I want on the click event of the command button open up a relevant form but close other forms .
Thanks
Code:
If CurrentProject.AllForms("frm_LM_Home").IsLoaded Then
else
DoCmd.Close acForm, me.name
End If
Thanks