Error numbers

Eddie Mason

Registered User.
Local time
Today, 15:40
Joined
Jan 31, 2003
Messages
142
Hi All,

Where can I get a list of error numbers? I'm getting error 3021 and 2105 on a database form.

Hope someone can help.

Regards

Eddie
 
Function AccessAndJetErrorsTable() As Boolean
Dim dbs As DATABASE, tdf As TableDef, Fld As Field
Dim rst As Recordset, lngCode As Long
Dim strAccessErr As String
Const conAppObjectError = "Application-defined or object-defined error"

On Error GoTo Error_AccessAndJetErrorsTable
' Create Errors table with ErrorNumber and ErrorDescription fields.
Set dbs = CurrentDb
Set tdf = dbs.CreateTableDef("AccessAndJetErrors")
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("AccessAndJetErrors")
' Loop through error codes.
For lngCode = 0 To 3500
On Error Resume Next
' Raise each error.
strAccessErr = AccessError(lngCode)
DoCmd.Hourglass True
' 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.
rst.Close
DoCmd.Hourglass False
RefreshDatabaseWindow
MsgBox "Access and Jet errors table created."

AccessAndJetErrorsTable = True

Exit_AccessAndJetErrorsTable:
Exit Function

Error_AccessAndJetErrorsTable:
MsgBox Err & ": " & Err.Description
AccessAndJetErrorsTable = False
Resume Exit_AccessAndJetErrorsTable
End Function
 
Hi Rich,

Many thanks for the advice

Regards

Eddie
 

Users who are viewing this thread

Back
Top Bottom