<% noads=1 %> <%dim crumb crumb="Access Error Method" crumb1="Access Error Method" %> VBA Error Method
Home  Fees/Services  Access Examples  Tutorials  Access Download  Articles  Search  Forums  Blockchain Tech  Contact  Privacy  Links
Application Object Examples
<%response.write crumb1 %>

Visual Basic Application Objects

Home > Access Tutorials > VBA Application Object Methods<%response.write " > " & crumb%>
 
<% dim Gnum,Ynum Gnum="4458683265" Ynum="7682" dim Page_Type Page_Type="Prog" %>





Access Error
AddToFavorites
BuildCriteria
CloseCurrentDatabase
CodeDB
CompactRepair
ConvertAccessProject


Access Error Method Example

Access Error Method - You can use the Access Error method to return the description associated with a Microsoft Access or DAO error when the error hasn't actually occurred.
However, you can't use the Access Error method for ADO errors in Visual Basic.

Application Object AccessError method Visual Basic example:

Function ErrorString(ByVal lngError As Long) As String

            ' begin Access Error method code

Const conAppError = "Application-defined or " & _
"object-defined error"

On Error Resume Next
Err.Raise lngError

If Err.Description = conAppError Then
    ErrorString = AccessError(lngError)
ElseIf Err.Description = vbNullString Then
    MsgBox "No error string associated with this error."
Else
    ErrorString = Err.Description
End If

' end Access Error method code

End Function

You should use VBA error handling code in all of you VBA modules, subroutines and functions.  If you use global variables and you do not have error handling in all subroutines then you will lose the values in your global variables when an unhandled error condition happens.















Contact Information

<% Response.write "Copyright 2000-" & year(now) & " Blue Claw Database Design" %>