Hiding forms

Christine Pearc

Christine
Local time
Today, 00:34
Joined
May 13, 2004
Messages
111
Having trouble getting the code right to hide and unhide forms.

I have a main menu from which users can open other forms. When another form is opened, I want the Main Menu to be hidden, so it doesn't appear in the task bar.

For example, from the Main Menu
Me.Visible = False
DoCmd.OpenForm "Review frm", acNormal

However, from Review frm, I can't get the Main Menu to be visible again. I've tried
Forms!Main_Menu.Visible = True
but it says it doesn't exist. (Note the name of the form, Main Menu, has spaces, which is why it has the underscore between the two words. Don't know if this is relevant or not.)

Could someone tell me what's wrong with the code?

Thank you.
 
Hi Christine.

I try not to make it a habit to reply on things I am not totally sure about, but I think you might try

Forms![Main Menu].Visible = True

I am pretty sure the space might be causing you at least part of the problem. Good luck!!
 
Thanks for trying, Vangogh.

I've already tried your suggestion, except instead of brackets with () like

Forms("MAIN MENU").Visible = False

The error message says it cannot find the form.

Anyone have any ideas?
 
You've posted two different versions of Main Menu so far, which one is correct?
 
Oops! In researching this problem I came across a post that said it wasn't good to have spaces between names, so since the original post I changed the form name from "Main Menu" to "MainMenu"; likewise I changed "Review frm" to "ReviewFrm".
 

Users who are viewing this thread

Back
Top Bottom