Closing form menu upon item selection.

Charlie2

Registered User.
Local time
Today, 20:19
Joined
Mar 28, 2002
Messages
79
Hello,
I have created a database in Access 2002 which on opening starts up a menu form containing buttons linking to the other forms in the database.

I have a macro setup on each form to maximize the size on opening, my problem is I want the previous form the menu to close when the menu item is selected upon the clicking of the relevant selection button.

I would also like the menu to re-open on the closing of the selected menu item.

How can this be achieved?


Cheers Charlie
 
I don't use macros, just VBA code, so you might want to wait for someone to post a macro solution, but it should be similar.

From the mainform, on each button, you have some code like this to open each individual form:
Code:
DoCmd.OpenForm "formname"
in order to hide the main form, you need some additional code like:
Code:
Me.Visible=False
to hide the main form

On the individual forms, when they close you'll want some code like this to run in the Close event of the forms:
Code:
If IsLoaded(Forms("name of your main form")) Then
    Forms("name of your main form").Visible=True
End If
DoCmd.Close acForm, Me.Name
You'll find the IsLoaded function by searching the forums. It's an optional functional to check if a form is loaded.
 
Thanks

dcx693 said:
I don't use macros, just VBA code, so you might want to wait for someone to post a macro solution, but it should be similar.

From the mainform, on each button, you have some code like this to open each individual form:
Code:
DoCmd.OpenForm "formname"
in order to hide the main form, you need some additional code like:
Code:
Me.Visible=False
to hide the main form

On the individual forms, when they close you'll want some code like this to run in the Close event of the forms:
Code:
If IsLoaded(Forms("name of your main form")) Then
    Forms("name of your main form").Visible=True
End If
DoCmd.Close acForm, Me.Name
You'll find the IsLoaded function by searching the forums. It's an optional functional to check if a form is loaded.


I will toy around with your solution.

Cheers Charlie
 

Users who are viewing this thread

Back
Top Bottom