Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    mjdemaris is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2016
    Location
    Washington State
    Posts
    12

    Code keeps breaking

    I haven't had any problems, that I'm aware of, until yesterday. (Problems of this nature, anyway.) For some reason Access wants to stop on one particular event: BeforeUpdate on some subform. I did use a code break for debugging, but that is temporary and is gone. Now, myself and other users have the same problem.



    Any ideas?

    This is a FE/BE setup, I have multiple users, on a company server.

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,398
    Not much to go on - what did you discover when you debugged? What is the code in your before update event? what error do you get?

  3. #3
    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
    And what, exactly, does

    "Access wants to stop on one particular event"

    mean?

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

    All posts/responses based on Access 2003/2007

  4. #4
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,389
    In the VBE, cut the procedure that has the phantom break with CTRL-X.
    Paste the code in a different place in the same module.
    Debug>compile.
    Save
    Compact/Repair.
    Should be OK.

  5. #5
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,398
    for benefit of responders, cross posted here

    https://www.access-programmers.co.uk...d.php?t=294158

    @mjdemaris - please read this thread about cross posting http://www.excelguru.ca/content.php?184

  6. #6
    mjdemaris is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2016
    Location
    Washington State
    Posts
    12
    Nothing came up when I debugged.
    Here is the code
    Code:
    Private Sub Form_BeforeUpdate(Cancel As Integer)'    Me.Requery
        
        If Me.RequestID_FK = 0 Then
            Me.RequestID_FK = Me.Parent!RequestID
            Me.DetailsStatusID_FK = 6
        End If
    End Sub
    It stops at the entry point. There is no error message displayed, it just stops highlighted in yellow.

  7. #7
    mjdemaris is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2016
    Location
    Washington State
    Posts
    12
    Thanks, Ajax. I was posting to find some answers quicker. I knew some of you are members on both sites, but I did not realize it would benefit to alert readers to this cross post.

  8. #8
    mjdemaris is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2016
    Location
    Washington State
    Posts
    12
    Linq - see above code.
    Dave - I followed your advice, it seems to work. I've tested it a couple of times, and deployed it, retested the deployed copy and it is working.

    Ideas on what causes this? It sounds as if you (Dave) have had this issue before.

  9. #9
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    It's called a ghost break. Sometimes compiling then compact/repair solves it. Other times, adding a bit of code (such as a message box line), then saving/compiling, then removing the newly added line and saving/compiling again is enough.

  10. #10
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,389
    I have experienced phantom breaks before. Don't know what causes them, but with 23 years of Access, you do learn a thing or two.
    Glad it worked out for you.

  11. #11
    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
    You're sure that

    Me.Requery

    is commented out, as the posted code shows? I ask because that line, used in the Form_BeforeUpdate event, will stop the Access Gnomes from saving the Record, which makes them mad and causes them to pop an error.

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

    All posts/responses based on Access 2003/2007

  12. #12
    mjdemaris is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2016
    Location
    Washington State
    Posts
    12
    Linq - yep, I had a problem with that earlier on, just never removed it. Going to do that now. Thanks!

  13. #13
    mjdemaris is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2016
    Location
    Washington State
    Posts
    12
    So, I still have this problem with ghost breaking, only now, it's in a different module. I've tried all the above, but it keeps returning. I even set it to compact on close, but no dice.

  14. #14
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Have you tried creating a new database and copying everything from "the problem database" to the new database?
    Might work, it is an often referenced technique when all else isn't working.

    Good luck.

  15. #15
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,398
    have you tried decompiling? - open the file with the decompile switch...

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. breaking a string down
    By Thompyt in forum Programming
    Replies: 7
    Last Post: 11-22-2016, 10:54 AM
  2. Breaking down a table with too many fields
    By maultiper in forum Database Design
    Replies: 3
    Last Post: 01-07-2016, 01:41 PM
  3. Database breaking
    By jj1 in forum Access
    Replies: 5
    Last Post: 11-25-2014, 02:17 PM
  4. Replies: 9
    Last Post: 06-02-2014, 08:10 AM
  5. Breaking Up table in FK and PK
    By drunkenneo in forum Programming
    Replies: 6
    Last Post: 12-07-2013, 12:59 AM

Tags for this Thread

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