List Run-Time Errors

T

TADropik

Using the simple code below, I'm able to list all errors (1 - 65,535).

For i = 1 To 65535
Print #1, i & ", " & Error(i)
Next i

However, the majority of those descriptions are:
"Application-defined or object-defined error"

Is there a way to find out what those application or object-defined errors
are?

For example;
Using the code above, Run-time error '3078' displays "Application-defined
or object-defined error"
When I actually create the run-time error, it displays:
"The Microsoft Jet database cannot find the input table or query."
 
D

Dirk Goldgar

TADropik said:
Using the simple code below, I'm able to list all errors (1 - 65,535).

For i = 1 To 65535
Print #1, i & ", " & Error(i)
Next i

However, the majority of those descriptions are:
"Application-defined or object-defined error"

Is there a way to find out what those application or object-defined errors
are?

For example;
Using the code above, Run-time error '3078' displays
"Application-defined
or object-defined error"
When I actually create the run-time error, it displays:
"The Microsoft Jet database cannot find the input table or query."


When the error description returned is "Application-defined or
object-defined error", use the AccessError function to retrieve the error
description Access has for that number. E.g.,

Dim strErrDesc As String

For i = 1 To 65535

strErrDesc = Error(i)
If strErrDesc = "Application-defined or object-defined error" Then
strErrDesc = AccessError(i)
End If

Print #1, i & ", " & strErrDesc

Next i
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top