Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jun 2001
    Location
    Salem, Oregon, USA
    Posts
    219
    Thanks
    0
    Thanked 0 Times in 0 Posts

    No err triggered unless breakpoint (Access XP on 2k machine)

    I have compact/repaired, rebooted, and still this wierdness persists.
    Mind you, I don't need it to work, I can find a workaround, it's just an anomaly.
    Pared-down module:

    Private Sub fRelatedItem_DblClick(Cancel As Integer)
    On Error GoTo FindRelated_err

    Me!fItem.SetFocus
    DoCmd.FindRecord fRelatedItem, , , acSearchAll
    Exit Sub

    FindRelated_err: ' NEVER GETS HERE unless I have a breakpoint.

    If Err.Number = 2046 Then
    MsgBox "Cannot find.. in this filtered or restricted set .. etc."
    Resume Next
    Else
    GeneralErr ("JumptoRelated") 'this commented out, as well as form_error module
    End If
    End Sub

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: No err triggered unless breakpoint (Access XP on 2k machine)

    Error 2046 is "this command is not available at the moment". The reason that it occurs when you are single stepping through the code is that the form does not have the focus at that moment. FindRecord can only be used if the form is really active.

  3. #3
    3 Star Lounger
    Join Date
    Jun 2001
    Location
    Salem, Oregon, USA
    Posts
    219
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: No err triggered unless breakpoint (Access XP on 2k machine)

    Oh, my! Something so simple!
    Thanks, Hans, for explaining it.
    Once again, I thought I had found a unique strippedy horse, when in fact it was your usual zebra.
    Pat

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •