Results 1 to 4 of 4
  1. #1
    P5C768 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Aug 2009
    Location
    Denver, CO
    Posts
    95

    Close Button for Popup, non-modal from

    I'm trying to track down a problem I'm having with a popup non-modal form that for whatever reason, when the form is closed, Access is minimized and the most recently used window is opened (even a non-Microsoft program will be maximized).

    The problem started when I tried to convert some VBA code (which was working) to an embedded macro:

    Code:
    Sub Command10_Click()
        DoCmd.Close
        DoCmd.OpenForm "MainMenu_frm"
        DoCmd.Maximize
    End Sub
    I tried the embedded macro option using just close, then close and open form, but every time I click the close button, it would minimize access. So I went back to the vba code above. However, now the VBA code cause the same issue. I am using Access 2007, with tabbed documents and I ran a compact and repair to no avail. Any ideas?

    Thanks!

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I never use macros, so I have no idea what the macro would be doing.

    I would delete the button, do a compact and repair, then create the button again. Make sure the click event has [Event Procedure] displayed. Re-enter the code but try

    DoCmd.Close acForm, Me.Name
    DoCmd.OpenForm "MainMenu_frm"
    DoCmd.Maximize

    "Command10" is not a good name (IMO - not descriptive)... I take the time to name objects; in this case I would name the button "cmdClose" or 'btnClose".

  3. #3
    P5C768 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Aug 2009
    Location
    Denver, CO
    Posts
    95
    That is basically what I have already done, I tried deleting the button and using the code you provided but I still get the same result. I also tried changing the form to not be pop-up and turning off tabbed documents, each with no effect.

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Then I would try import the objects to a new database. Sounds like corruption....

    If that doesn't work, delete and re-create the form.

    Do you have the "Always use Events" check box checked in the options? And "Autocorrupt" is unchecked? OOPS, I mean "Autocorrect".

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

Similar Threads

  1. Replies: 1
    Last Post: 03-20-2013, 07:04 AM
  2. Replies: 4
    Last Post: 01-20-2013, 06:34 PM
  3. Close Button
    By cbrsix in forum Programming
    Replies: 7
    Last Post: 07-30-2012, 09:23 AM
  4. Replies: 1
    Last Post: 02-17-2011, 06:23 AM
  5. Add a close button?
    By thestappa in forum Reports
    Replies: 1
    Last Post: 07-15-2010, 10:43 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