Opening Forms On Top Of Each Other



In my database, I have a switchboard that controls the initial selections.
When that selection is made, another form opens on top of the switchboard.
Is that a good idea, or should I close the initial form when the other one
opens? If that is the case, I have been unsuccessful at making that work.
Your guidance would be greatly appreciated.


Albert D. Kallal

There is no hard and fast rule.

In some applications, your users might want to open one form, then minimize
it, and then while on the switch board, launch another form....perhaps even
do this a 3rd time.

However, if you have a serious of forms that need to be completed, then
obviously you don't want you users retuning to the switch board without
FIRST close the form they are on....

In most, (if not all) of my applications, I don't hide the previous form,
but a VERY large portion of my forms are model. That means that I might
have a button on the form that opens another form. However, the user can NOT
return back the way the came unless they close the existing form (they have
to do this since my forms are set as modal). Hence, they continue this
process of closing the form, and returning all the way back to the

You can also consider a design where each form is model, and also maximised.
This means that the current open form will ALWAYS cover up the previous

In other cases, I tend to just size the forms so that they cover *most* of
the previous form.

So, I think the "main" issue would be do you want to allow several forms
open, and can the user switch between them, *or* must they close the current
form they are on to return to the previous form...


I would close the previous form when opening the new one. If you open
the other form via a command button, then I would modify slightly the
code that is given from the button command wizard. Below Is the coding
I used in a database I currently have.

Private Sub Personnel_Button_Click()
On Error GoTo Err_Personnel_Button_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Personnel"

stLinkCriteria = "[Name Line.SSN]=" & "'" & Me![SSN] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit Sub

MsgBox Err.Description
Resume Exit_Personnel_Button_Click

End Sub

If you look above, this button is programed to open a specific record
in a different form using "stLinkCriteria". Right after is the
"DoCmd.Close", which will close the previous form and then
"DoCmd.OpenForm" which will open the new form on the specific record.



Thanks for the input. Does the Personal_button exist on the form to be
closed, or is it just a sub routine? I am not very well versed in VBA. I
have fixed my form overlay problem. All of my forms are set to Auto Center
and as long as I am careful to insure that they are the same size, the issue
is fixed.




All of my forms are model and I see no issue with leaving them open, since
if the user wants to go back, they only need to close the form they are in.
Thanks for all of your good information.


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