Results 1 to 3 of 3
  1. #1
    chris.williams is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2011
    Posts
    94

    Macro Error - Access Stops Responding

    Hi all - I recently made many changes to a working FE (I say this because I don't know what change caused this issue).

    I have a "logout" button on a form which runs the following function:



    Code:
    Public Function CleanUpandRestart()
    
    Dim intLoop As Integer
    
    For intLoop = (Forms.Count - 1) To 0 Step -1
    DoCmd.Close acForm, Forms(intLoop).Name
    Next intLoop
    
    TempVars.RemoveAll
    DoCmd.RunMacro "Autoexec"
    
    End Function
    The autoexec function loads a login form which used to work great. On a successful login, it would open the same form as the logout button is on.

    The issue is when the database is opened for the first time, everything works as it should. However, when the logout button is clicked and the user logs back in, three things happen:

    1. I get a write conflict error (attached)Click image for larger version. 

Name:	Write Conflict Error.png 
Views:	6 
Size:	20.2 KB 
ID:	9586
    2. I get a macro error (attached)Click image for larger version. 

Name:	Macro Error.png 
Views:	6 
Size:	23.2 KB 
ID:	9587
    3. Access stops responding and dies (error attached)Click image for larger version. 

Name:	Screen Shot 2012-10-19 at 10.22.56 AM.png 
Views:	6 
Size:	30.3 KB 
ID:	9588


    If I press the logout button, then exit the login form (leaving all forms closed), I can rerun the autoexec and login properly.

    The form that a successful login opens is an unbound form but it does have several subforms on it which are bound to different queries. No changes to the data are being made, so I am a bit confused at the initial "Write Conflict" error.

    The backend is a MySQL database and I am not making any SQL calls via VBA on this form, or any of the subforms that are loaded.

    Any help would be appreciated.

  2. #2
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    (One reason I don't like or use macros!)

    Are you able to determine which step of the macro is causing the issue? If all the macro does is open the form, you could try opening the login form from your CleanupandRestart sub,
    using docmd.openform instead of docmd.runmacro. Does the Login form run any code which might be causing the problem?

    HTH

    John

  3. #3
    chris.williams is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2011
    Posts
    94
    I have not been able to track it down. What I see happening is -sometimes- this fails immediately, after the second login, or -sometimes- it happens on subsequent logins.

    It also does not give me an opportunity to open the debug/VBA console - Access just stops responding.

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

Similar Threads

  1. Combo Box Error Stops Function
    By Phred in forum Forms
    Replies: 3
    Last Post: 01-28-2012, 02:21 PM
  2. Replies: 3
    Last Post: 12-13-2011, 06:09 PM
  3. Access Not Responding
    By Phoenyxsgirl in forum Access
    Replies: 11
    Last Post: 11-25-2011, 11:40 AM
  4. Macro stops working for 'USER' group
    By EliOklesh in forum Security
    Replies: 1
    Last Post: 10-28-2011, 07:54 PM
  5. Access Query Not Responding
    By sunharepal in forum Programming
    Replies: 4
    Last Post: 10-22-2010, 10:39 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