MS Access 2013: My main navigation form has a handy button that closes all open forms using the following code:
Private Sub Btn_CloseAllForms_Click()
Dim intLoop As Integer
For intLoop = (Forms.Count - 1) To 0 Step -1
DoCmd.Close acForm, Forms(intLoop).Name
The problem is that it closes the main navigation form too, which I want to keep open.
I can re-open the form by inserting the following code just before End Sub:
DoCmd.OpenForm "F_Nav_Main", acNormal
This works, but closing and then re-opening the main navigation form does not seem like a very efficient
solution. I have tried several other ways to exclude the main form from being closed, but cannot anything to work.
Can anyone think of a better way to do this ?