Results 1 to 7 of 7
  1. #1
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664

    Macro fails on closing form


    The thread relates to another thread on the forum, but I think that it is independent enough to warrant its own thread. In the db that
    is attached as a zip file when one opens fromProjectManagement everything is fine. Now when you try and close the form using the Close
    Form button not so much. This crashes and give an error in the VBA code, not even in the macro.

    The macro could not be simpler sinceit was created by the Macro wizard and all it does is close a form. Wht is cassuign this error and how
    do I fix it.

    Respectfully,

    Lou Reed
    Attached Files Attached Files

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    since I cant see the code, I would assume there is a pending operation preventing the close.
    Close is pretty simple.

  3. #3
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    I included a zip file of the db. All one has t do is unzip it run it and see what I am talking about.

    Respectfully,

    Lou Reed

  4. #4
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Lou, please remember that not everyone will download database files, for security reasons. Your flippant response to Ranman256 was uncalled for.

    That said, I did download your DB; the form opens and closes fine when opened from the switchboard. The error occurs when you open the form on its own - when closing, it references the switchboard form which is not open, causing the error.

  5. #5
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    I in no way meant to be flippant. I am just unsure why that form fails to close with a program crash (there is also a second form that fails to close in a similar way) and everything else closes fine.
    Please understand, I included the form for the reason that "seeing is believing". There was absolutely no intention of disrespect or flippancy.
    I was just trying to help someone who wanted to solve the problem. If you have the code then there is no need to guess or speculate.
    The cod is right there. everything that you need to know is included.

    I am very grateful for the help I received here. I certainly meant no harm; if it came off that way then I am truly sorry.

    Sometimes I type too quickly without thinking. Do not confuse my haste for rudeness.

    Respectfully,

    Lou Reed

  6. #6
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    John_G:

    I see your point. I almost never use the switchboard when I am creating forms, tables and VBA code. I open the specific form either in design mode or form mode and work from theree. That does not mean that in there are no elaborate form operations.
    There are.
    Now how do I get the frmProjectManagement and frmConfigure to operate only when they and they alone are opened and closed?

    Any help appreciated. Thanks in advance.

    Respectfully,

    Lou Reed

  7. #7
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Both those forms have one line in the On_Close event : Forms!DivisionDashboard.Update_Actions

    and it is that line that causes the error through the reference to the DivisionDashboard form. Just delete the whole On_Close Sub (all three lines of it!) in each form and they should close without error.

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

Similar Threads

  1. Replies: 3
    Last Post: 11-30-2016, 09:02 AM
  2. Error Message When Closing a Form w/ Macro
    By KCC47 in forum Programming
    Replies: 8
    Last Post: 11-14-2014, 03:35 PM
  3. ADO Update fails after Form Refresh
    By EddieN1 in forum Programming
    Replies: 4
    Last Post: 12-19-2011, 08:07 PM
  4. search criteria in a form fails!
    By maxbre in forum Programming
    Replies: 2
    Last Post: 12-01-2010, 06:21 AM
  5. Printing form: image fails to update
    By stellar0645 in forum Forms
    Replies: 6
    Last Post: 02-04-2010, 11:41 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