Can one form replace another in the same window?

scottydel

Registered User.
Local time
Today, 10:57
Joined
Apr 18, 2007
Messages
35
Hi,

I have a Main form that spawns other forms. Currently, when I click a button in Main to spawn a new form, a new window is opened containing the new form, and the current window containing Main stays open.

Is there a way to keep only one window open, and have the new form appear in the same window (so Main is no longer visible, but the new form is)? I have buttons on all of the spawned forms "Return to Main" and I'd like to have the reverse take place when that is clicked.

Is this just as simple as Form.Close and Form.Open, or is there something trickier? I'd ultimately like the window to keep the exact same size and position on the screen, so it looks very seamless.

Kinda like the way MS Explorer gives you a choice under Tools -> Folder Options:

-Open each folder in the same window
-Open each folder in its own window

I would like my app to open each form in the same window.

Thanks,

Scott
 
you could minimize the main window and restore it when u want it back
 
As your thinking it is as simple as using the onopen and onclose events....

Private Sub Form_Close()
Dim stDocName
Dim stLinkCriteria
stDocName = "frmMenu"

DoCmd.OpenForm stDocName, , , stLinkCriteria

End Sub



Control size and position of forms
DoCmd.MoveSize 2000, 2000, 2000, 2000

where 2000 is distance from right, 2000 is distance from Top 2000 is width of form and 2000 is height of form.
 
If i understand you right then you could put a subformwindow on the main screen and then change the subformwindow source to each different form you want to open.

Dan
 

Users who are viewing this thread

Back
Top Bottom