Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error Message(s) in Microsoft Access 2

Status
Not open for further replies.

PJname

MIS
Jun 15, 2004
73
US
[rednose]

Can someone tell me where I can find a document that has a listing of all the Error(s)messages and possible
solution(s) to these error(s) for Microsoft Access?


I had a user who was trying to run a compact and repair on a MS Access database and he received the following error box:

Microsoft Access

Could not find field 'Description'.


Why and what would cause this message box to appear?


He normally compacts this database with no problems, but for some reason when he tried to compact today, received the above error.

Thanks in advance for your HELP.....



 
No such document exists, that I've ever heard of. The best you can hope for is to hit F1 when the error occurs. Sometimes the Help file is actually helpful.

It sounds to me like you're used to IBM mainframe software manuals. :)

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
PJname
This looks like access default error message!

The developer didn't add any error handler somewhere in the code.

All Subs or Functions Should Resemble This Code...
Notice the code in BLUE
Code:
Private Sub Command4_Click()
[COLOR=blue]On Error GoTo Err_Command4_Click[/color]

    Dim stDocName As String

    stDocName = "qryProducts"
    DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_Command4_Click:
    Exit Sub
[COLOR=blue]
Err_Command4_Click:
'Popup a msg, give desc, Adds image and sets user choice, give msgbox a title
    MsgBox Err.Description, vbExclamation + vbOKOnly, "Error during Command4_Click"
    Resume Exit_Command4_Click
[/color]    
End Sub

Now this code will display a little more info, than what your getting now.

To modify the Error Message to get the error number

MsgBox Err.Number & " " & Err.Description
Now try searching MS knowledgebase for the error number.

Type err. in the VBE window and you'll see some of your choices.


My guess is, I field from a table or query was renamed or deleted. Or your losing the reference to it one a form.


As for your actual post:
PJname said:
Can someone tell me where I can find a document that has a listing of all the Error(s)messages and possible solution(s) to these error(s) for Microsoft Access?

None that I've found. Search by number or start your own error table, and log them.

You should find several threads regarding how to log errors

Hope This Helps...


AccessGuruCarl
Programmers helping programmers
you can't find a better site.
 
PJname
There is a way to generate a table of all the Access error code #s and their meaning.

I have it on my laptop computer.

If you want it, I can send it to you.

The table doesn't indicate the fixes, but it is handy to be able to look it up in the table.

Tom
 
The message you are receiving is because themdb file is corrupt. Import all the objects into a new blank mdb and then recompile, compact & repair.

Ed Metcalfe.

Please do not feed the trolls.....
 
Attention! Thwatson,

If you can send me the information on how to generate a table with the error codes, I would appreciate it. This will be useful information for future use.

[bigsmile]
 
PJname
Here are the steps...

1. Make a table called tblErrorsAndDescriptions, with two fields:
ErrorNumber Number data type Indexed Yes No Duplicates
ErrorDescription Memo data type

2. Make a Module with the following code. You should be able just to paste this in.
Code:
Function sRecordAccessErrorMsg()

Dim ADOcnn As ADODB.Connection
Dim ADOrst As ADODB.Recordset

Dim intCounter As Long
Dim intErrornumber As Long
Dim strErrorText As String

Set ADOcnn = CurrentProject.Connection
Set ADOrst = New ADODB.Recordset

ADOrst.Open "tblErrorsAndDescriptions", ADOcnn, adOpenDynamic, adLockOptimistic

With ADOrst
    For intCounter = 0 To 32767
        .AddNew
        !ErrorNumber = intCounter
        If IsNull(AccessError(intCounter)) Then
            !ErrorDescription = "No Error"
        ElseIf AccessError(intCounter) = "" Then
            !ErrorDescription = "No Error"
        Else
            !ErrorDescription = AccessError(intCounter)
        End If
        .Update
    Next intCounter
End With

MsgBox "Completed enumerating errors to the table."

End Function

3. Run the module in the Immediate Window. Debug.Print etc.

Hope that helps.

Tom
 
Thanks THWatson, I followed your instructions above and now have a table with the Error numbers.....

 
Late Post, my two cents...

I use this for all new db creation to add an error table to the db.

Place in Module the following code...
Code:
Function FillNewErrorTable()
    Dim MyDB As dao.Database, MyTable As dao.Recordset
    Dim tableName As dao.TableDef
    Dim field1 As Field
    
    Set MyDB = CurrentDb()
    Set tableName = MyDB.CreateTableDef()
    tableName.Name = "lkupErrorCodes"
    
    ' create a text type field with a length of 15
    Set field1 = tableName.CreateField("Err", dbInteger, 6)  ' had to change to tablename
    Set field2 = tableName.CreateField("Error", dbText, 255)
        
    ' Append the field to the table first
    tableName.Fields.Append field1
    tableName.Fields.Append field2
    
    ' then append the table to the tables collection
    ' otherwise, your table will not be stored permanently
    With MyDB.TableDefs
         .Append tableName
    ' refresh in case of multi-user environment
         .Refresh
    ' update entire db window for immediately reflecting changes
    '   .RefreshDatabaseWindow  Didn't like this!!
    End With
         
'            Dim MyDB As dao.Database, MyTable As dao.Recordset
         Dim i As Integer
         Dim e$

         Set MyDB = CurrentDb()
         Set MyTable = MyDB.OpenRecordset("lkupErrorCodes")

         For i = 1 To 32766
            e$ = Error$(i)
            If e$ <> "User-defined Error" And e$ <> "Reserved Error" Then
               MyTable.AddNew
               MyTable![Err] = i
               MyTable![Error] = e$
               MyTable.Update
             End If
         Next i
         MyTable.Close
         MyDB.Close
      End Function

Then run the function in the immediate window
? FillNewErrorTable

Donald M
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top