Setting forms from visible to not visible

D

DaveFrag

I have a series of forms that I display only when they're requested by the
user. The initial form opens when the project is opened and then other forms
are opened based on the users request. I set "Forms!...Visible = False" as
each new form opens, and then as each form closes I set "Forms!...Visible =
True" although the forms that I've hidden, appear to have been closed and
don't respond to the request to display the form. Any help is greatly
appreciated.
 
J

Jeanette Cunningham

Hi DaveFrag,
So if you open one form from the main menu, then close it again, doesn't the
main menu become visible again?
I would expect that it would.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
D

DaveFrag

Hi Jeanette -
Form #1 opens when I launch the project. Form #2 is opened after the user
clicks on the continue button on Form #1 and Form #1 is hidden. The user
then makes a selection on form #2 which opens up form#3 at which time form#2
is hidden. When Form#3 is closed, form#2 should be visible, but it isn't.
When I check to see what forms are hidden, form#1 is the only one. Thanks
for you help.
- Dave
 
J

Jeanette Cunningham

Let's work out what happens to form#2.
To find out if a form is open (hidden or not) we can use
CurrentProject.AllForms(form#2Name).IsLoaded
-assuming A2000 or later.

In the code that closes form#3, before form#3 is closed, put some code like
this
DebugPrint.CurrentProject.AllForms(form#2Name).IsLoaded

Replace form#2Name with the actual name of the form and enclose the name in
double quotes.

Put that line of code above the code that closes form#3.

Run the forms through the routine from opening form#1 to closing form#3.
Open the immediate window by pressing Ctl+G
You will see either True of False.

Post back with the result.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
D

DaveFrag

Jeanette -

Your suggestion to add that diagnostic code did the trick. I was able to
determine that the hidden form was infact loaded and because I was trying to
make the form visible before closing my current form, caused the issues. All
forms are set as Popup and Modal which may have added to the issue. Thanks
for all you help.

- Dave
 

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

Top