Results 1 to 6 of 6
  1. #1
    Paul H's Avatar
    Paul H is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591

    Hide and Unhide forms

    Hello,



    I have a main form that opens other forms. These forms in turn open other forms, etc. What happens is I end up with a pile of forms of different sizes that poke out from behind the next form that opens. I am looking for a simple way to hide and unhide these forms when they lose focus and get focus, but I am finding that neither of those events are occurring. I did switch to using the command button that calls the next form to set the current forms Visible property to False. What I can't figure out is how to set the invisible form's Visible property back to true. I want to work it out so only one form is visible at a time. I am doing it this way because I can't close the current form since the new forms depend if the previous forms. Since the previous form I want to display is still open I can't use the OnLoad event or the On Open event.

    Previously the application displayed the forms in tabs which completely covered the previous form so this was not a problem. I just thought this didn't look professional and changed Document Windows property to overlapping tiles.

    Hope you can help.

  2. #2
    Dave14867's Avatar
    Dave14867 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Nov 2016
    Location
    Upstate NY
    Posts
    376
    I would suggest using VBA to "minimize" a form when you don't want it visible, and "maximize" when you do. I don't know what you are doing and when you want to make a form visible and not visible because I don't have enough info but see if that helps.

  3. #3
    Paul H's Avatar
    Paul H is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591
    I want to hide it(turn Visible to False) when the new form pops up and unhide when that form closes. Hiding it is easy. Unhiding it (turning visible back to True) is where I'm stuck. Minimizing it would not be my choice since it would still be visible to the user.
    I'm unsure how to set the original forms Visible property back to True.

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    Try:

    Forms!NameOfForm.Visible = True

    When you close hide the second form
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    Quote Originally Posted by Paul H View Post

    ...I am looking for a simple way to hide and unhide these forms when they lose focus and get focus, but I am finding that neither of those events are occurring...
    That's correct! What you need to know is that a Form cannot receive or lose Focus if it has one or more Controls that can receive Focus!

    Seems odd, I know, but it is what it is! For this kind of thing you need to use the Form_Activate()/Form_Deactivate() events.

    Because you cannot return Focus to a Form that is invisible, I agree with Dave about using the Minimze/Maximise commands for this.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  6. #6
    Paul H's Avatar
    Paul H is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591
    Quote Originally Posted by Missinglinq View Post
    I agree with Dave about using the Minimze/Maximise commands for this.
    That seems to be work.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Hide and unhide arrows
    By tarhim47 in forum Programming
    Replies: 1
    Last Post: 09-20-2011, 07:54 PM
  2. Replies: 1
    Last Post: 05-23-2011, 07:11 AM
  3. Hide or Unhide Fields in Query using VB
    By SCFM in forum Programming
    Replies: 4
    Last Post: 03-12-2010, 01:24 PM
  4. How can I hide/unhide DB window with a single button?
    By aquaraider in forum Programming
    Replies: 2
    Last Post: 10-09-2009, 07:01 AM
  5. Hide/UnHide forms
    By access in forum Forms
    Replies: 3
    Last Post: 06-03-2009, 07:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums