Results 1 to 2 of 2

Thread: 2051 (2003)

  1. #1
    2 Star Lounger
    Join Date
    Mar 2002
    Posts
    164
    Thanks
    0
    Thanked 0 Times in 0 Posts

    2051 (2003)

    I've scoured the net trying to find a solution to this problem, but haven't found crap. Iv'e got the following search button...

    Private Sub Search_Bttn_Click()
    On Error GoTo Err_Search_Bttn_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "Edit - Projects"

    stLinkCriteria = "[Project_Num]=" & "'" & Me![Project_Num] & "'"
    DoCmd.Close
    DoCmd.OpenForm stDocName, , , stLinkCriteria

    Exit_Search_Bttn_Click:
    Exit Sub

    Err_Search_Bttn_Click:
    MsgBox Err.Description
    Resume Exit_Search_Bttn_Click

    End Sub

    If it doens't find a record, I get the following...

    The OpenForm action was cancelled. I have a feeling it has to do with error 2051 (I believe it is). Is there a way to avoid this error?

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

    Re: 2051 (2003)

    See your own code in <post#=561,349>post 561,349</post#> ( I think it's error 2501, not 2051)

Posting Permissions

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