Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Feb 2006
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Error number (2000)

    Hi,

    I would like to know what's the error number in VB of the following error message:

    The changes you requested to the table were not successful because they would create duplicate values in the indes, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again.

    Also how can I find out the error munber for error message in VB?

    Thanks

    Regards

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

    Re: Error number (2000)

    Use the following structure as "template" for your code during testing

    Sub MyProc()
    ' Declarations
    Dim obj As Object

    On Error GoTo ErrHandler

    ' Main code
    ...

    ExitHandler:
    ' Clean up
    Set obj = Nothing
    Exit Sub

    ErrHandler:
    ' Report error number
    MsgBox Err.Number & " " & Err.Description, vbExclamation
    Resume ExitHandler
    End Sub

    This way, you'll always see the error number.

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error number (2000)

    Also check out Error codes (Access XP) from Hans

    <post#=312715>post 312715</post#>

    HTH, John

  4. #4
    4 Star Lounger
    Join Date
    Feb 2006
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error number (2000)

    Thanks, all. It's works.

Posting Permissions

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