By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,960 Members | 2,459 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,960 IT Pros & Developers. It's quick & easy.

List of error nums / descrips?

P: n/a
MLH
If Err.Number = 2001 Then

I have the above line in a procedure
I downloaded. I don't know what error
that is exactly.
Apr 12 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
MLH <CR**@NorthState.net> wrote:
: If Err.Number = 2001 Then

: I have the above line in a procedure
: I downloaded. I don't know what error
: that is exactly.

It's the dreaded 'You canceled the previous operation' error.
It seems to happen a lot in badly specified DLookUp calls.
--thelma
Apr 12 '06 #2

P: n/a
MLH wrote:
If Err.Number = 2001 Then

I have the above line in a procedure
I downloaded. I don't know what error
that is exactly.


Look at the CVErr example in help.
Apr 12 '06 #3

P: n/a
MLH <CR**@NorthState.net> wrote:
: If Err.Number = 2001 Then

: I have the above line in a procedure
: I downloaded. I don't know what error
: that is exactly.

Also, I found this for generating a list of VBA error codes.
The person listed did all the work: I just found it by googling,
so any thanks [or complaints] are due to Van Dinh

--thelma
From: Van T. Dinh - view profile
Date: Thurs, Jan 17 2002 8:11 pm
This is the code I used to generate a Table of Errors in A97. If you use
A2K, make sure DAO 3.6 Library is in the References Collection of your

Database.
HTH
Van T. Dinh

********
Public Function AccessAndJetErrorsTable() As Boolean
Const conAppObjectError = "Application-defined " & _
"or object-defined error"

Dim dbs As DAO.Database, tdf As DAO.TableDef
Dim fld As DAO.Field, rst As DAO.Recordset
Dim lngCode As Long
Dim strAccessErr As String

On Error GoTo Error_AccessAndJetErrorsTable
DoCmd.Hourglass True

'Create Errors table with ErrorNumber
'and ErrorDescription fields.
Set dbs = CurrentDb
Set tdf = dbs.CreateTableDef("tblAccessAndJetErrors")

Set fld = tdf.CreateField("ErrorCode", dbLong)
tdf.Fields.Append fld
Set fld = tdf.CreateField("ErrorString", dbMemo)
tdf.Fields.Append fld

dbs.TableDefs.Append tdf

'Open recordset on Errors table.
Set rst = dbs.OpenRecordset("tblAccessAndJetErrors")

'Loop through error codes.
For lngCode = 0 To 3500
On Error Resume Next
'Raise each error.
strAccessErr = AccessError(lngCode)

'Skip error numbers without associated strings.
If strAccessErr <> "" Then
'Skip codes that generate application or
'object-defined errors.
If strAccessErr <> conAppObjectError Then
'Add each error code and string to Errors table.
rst.AddNew
rst!ErrorCode = lngCode
'Append string to memo field.
rst!ErrorString.AppendChunk strAccessErr
rst.Update
End If
End If

Next lngCode
'Close recordset and destroy object vaviables.
rst.Close
Set fld = Nothing
Set rst = Nothing
Set tdf = Nothing
Set dbs = Nothing

RefreshDatabaseWindow
MsgBox "Access and Jet errors table created."
AccessAndJetErrorsTable = True
DoCmd.Hourglass False

Exit_AccessAndJetErrorsTable:
Exit Function

Error_AccessAndJetErrorsTable:
MsgBox Err & ": " & Err.Description
AccessAndJetErrorsTable = False
Resume Exit_AccessAndJetErrorsTable
End Function
********

"Alfred" <a...@jam.co.za> wrote in message
Apr 12 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.