Results 1 to 6 of 6

Hide and Unhide forms

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

    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.
    Thanks, Paul

  2. #2
    Dave14867's Avatar
    Dave14867 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Nov 2016
    Location
    Upstate NY
    Posts
    269
    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.
    Dave

    Learn Something new everyday. A day in which you learn nothing is a wasted day.

  3. #3
    Paul H's Avatar
    Paul H is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    503
    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.
    Thanks, Paul

  4. #4
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    2,094
    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.
    Not everyone can access an accdb, you may reach a broader audience by attaching in mdb format.

    Bob Fitzpatrick

    I have never failed. I have found a thousand ways that do not work!

    Microsoft Community Contributor Award (2011)



  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
    2,886
    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
    503
    Quote Originally Posted by Missinglinq View Post
    I agree with Dave about using the Minimze/Maximise commands for this.
    That seems to be work.
    Thanks, Paul

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
  •  
Tech Forums: Microsoft Office Forums