Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    The zipped db and a SnagIt screenshot are attached.



    I got past the error. I did it by not walking through the code just running the sub. It seems to want to stop with error 2487 when I am debugging and walking through the code.

    Now it goes down to the third marked line. I am not sure why it stops there it just says

    exit Sub

    It seems that the error goes way if you choose not to walk through the code. But how do you avoid exiting the sub altogether?

    Any help appreciated. Thanks in advance.

    Respectfully,


    Lou Reed
    Attached Files Attached Files

  2. #17
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    Again, need an answer to this issue in the last post. How come the error only shows up when I walk through the code and why is it stopping
    at Exit Sub?

    Respectfully,

    Lou Reed

  3. #18
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Again, need an answer to this issue in the last post. How come the error only shows up when I walk through the code and why is it stopping
    I was able to replicate the error. Evidently when in the VBA code screen, which is where you are after you hit a breakpoint, Access does not recognize the fact that it is still "in" a form, and what the form name is. You can fix it by explicitly indicating the object type (acDataForm) and the object name ("frmPersonnel) on the SearchRecord line:


    DoCmd.SearchForRecord acDataForm, "frmpersonnel", acFirst, "[PersonnelID] = " & Me.Combo170

    But how do you avoid exiting the sub altogether?
    Not sure what you mean by that - you want to exit the sub when it is completed. However, when in break mode, the code window does not close when stepthrough hits Exit Sub or End Sub. (IMO that is a very poor implementation by Microsoft). So one your stepthrough hits Exit Sub or End Sub, just close the window with the "X".

  4. #19
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    Okay, that suggestion on the last Post corrected the error.

    Thanks very much.

    Respectfully,

    Lou Reed

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

Similar Threads

  1. Replies: 7
    Last Post: 02-07-2017, 05:19 PM
  2. Replies: 7
    Last Post: 03-30-2015, 10:04 AM
  3. Replies: 5
    Last Post: 04-09-2014, 06:57 PM
  4. Replies: 3
    Last Post: 07-03-2013, 10:38 AM
  5. Replies: 1
    Last Post: 10-30-2012, 10:29 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