AccessBlog.net

News, links, downloads, tips and tricks on Microsoft Access and related

About Me Search
Alex
Name:Alex Dybenko

Location:Moscow, Russia

Thursday, October 09, 2008

Getting Run-time errors descriptions

This is from the post of Dirk Goldgar, Access MVP, I saw the question in newsgroups, but forgot about this AccessError() function. Keeping it here. It only works on English Access, so for localized version you have to adjust it.

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

Labels:

1 Comments:

Anonymous Data Entry Services said...

This is a helpful little function. Hate for users to see the generic error messages Access generates. It is useful to capture an error and based on the results, show your users a more descriptive message.

2:38 PM  

Post a Comment

Links to this post:

Create a Link

<< Home