Results 1 to 2 of 2
  1. #1
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383

    Trap Error 2476 Code

    I am trying to trap this error unsuccessfully! Here is my code! I still get the same error message; From name is TimeCards



    Dim FrmCtxID As Long
    Dim ID As Long


    FrmCtxID = Screen.ActiveForm.HelpContextId

    On Error GoTo Err_Form_Load:

    If Me.RecordsetClone.RecordCount = 0 Then
    MsgBox "No TimeCards have been found matching your request", vbOKOnly
    Cancel = True
    End If

    If Me.NewRecord = True Then
    Exit Sub
    End If


    End_Form_Load:
    Exit Sub

    Err_Form_Load:
    If Err.Number = 2476 Then
    Resume Next
    Else

    Resume End_Form_Load

    Exit Sub
    End If
    Last edited by burrina; 01-18-2013 at 09:32 AM. Reason: form name is TimeCards

  2. #2
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254
    burrina -

    I might be mistaken but, I looked in my list of trappable errors and didn't see Err 2476 : "The expression refers to an object that is closed or doesn't exist."

    So, you may not be able to trap the error. Regardless, you might try to isolate the line in which the error is occurring. If it is: FrmCtxID = Screen.ActiveForm.HelpContextId
    and the control "HelpContextId" is on the Main Form then, you might be able to use FrmCtxID = Me.HelpContextId. Otherwise, if that control is on the subform, you may have to refer to it differently or in a more explicit manner.

    Hope this helps,

    Jim

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

Similar Threads

  1. Replies: 1
    Last Post: 11-30-2012, 02:04 PM
  2. Building a better mouse trap :)
    By ldodge in forum Access
    Replies: 29
    Last Post: 06-30-2011, 08:15 AM
  3. Replies: 7
    Last Post: 03-04-2011, 12:46 PM
  4. trying to trap a redundancy
    By jreed72 in forum Access
    Replies: 7
    Last Post: 11-07-2010, 10:43 PM
  5. Using variables to trap write conflicts
    By ajetrumpet in forum Programming
    Replies: 2
    Last Post: 09-07-2010, 12:54 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