Getting rid of multiple form windows

sugar05

Registered User.
Local time
Today, 15:01
Joined
Dec 7, 2005
Messages
22
Hi,

I have a database that contains a navigation menu. It links to several other forms throughout the database, providing users with easy access to the databases features. At the moment, when each link is clicked, it opens another seperate window with that form as the contents. As you can imagine, after a session, the user has around 20 different forms all along the taskbar, just from navigating through the database. Is there a macro or command that I can put in place to 'replace the existing window' when a link is clicked, so only one window is open at the end of a session? (The simpler the better in terms of explinations, macros aren't my best area). :)
 
I am assuming that the navigation menu is a form and that the form has command buttons on it to open different forms.

If so, then just close the Navigation form after it opens the "New" form.

In other words if form1 has a command button on it to open form2 then in the code that opens form2 put code that will close form1.

If most of your forms are opened from the Navigation form then you could close it when the required form opens and again when the current form on the screen is closed (with a command button) it would open the navigation form.

Now if form6 can be opened from form1, form2 & form3 and when it (form6) is closes you would like to go back to the form that opened it, then you would have to use OpenArgs (Open Arguments).

If this is as clear as Mud, it may be because I am a Magpie supporter.
 
sugar05 said:
I have a database that contains a navigation menu. It links to several other forms throughout the database, providing users with easy access to the databases features. At the moment, when each link is clicked, it opens another seperate window with that form as the contents. As you can imagine, after a session, the user has around 20 different forms all along the taskbar, just from navigating through the database. Is there a macro or command that I can put in place to 'replace the existing window' when a link is clicked, so only one window is open at the end of a session? (The simpler the better in terms of explinations, macros aren't my best area).

If you are getting 20 different forms, then perhaps your database has outgrown your menu?

A better way to implement a menu with a database with more than just a few forms is to use a menubar. That is neater and allows you to catagorize the different selections into logical groups.

To address your specific question, there are ways to have Access keep track of what window is open and shut it before opening a new one. You can use a global variable, or have a hidden form with the name of the active form, or have it close all forms that are open (except for the menu) before opening the new one, etc...

A better way to do it your way would be to use subforms all placed in one form where the menu is on the side, and the user clicks the choice which will display the appropriate subform. I have included a screenshot of how I've done this.

Some similar possiblities would be to replace those buttons that I put on the side with a tree control. That is an especially good idea if you have a lot of choices so you can subgroup them and expand and collapse. (Kind of like outlook). It will take a bit of learning to implement the treeview, but there's a lot of good advice on this forum!

SHADOW
 

Attachments

  • PrintMenu.jpg
    PrintMenu.jpg
    15.4 KB · Views: 148
Go to Tools, Options and in the View tab, uncheck 'Windows in Taskbar'.
 
thanks ansentry. your idea works a treat :)
 

Users who are viewing this thread

Back
Top Bottom