Home  Fees/Services  Access Examples  Tutorials  Access Download  Articles  Search  Contact  Privacy  Links
Custom Database Design Consultants
 
Access Programming Examples
 
Access Example Downloads
Access Application Object Examples

Application Object Method Examples
Methods for Controlling Access Objects

Access Tutorials>Application Object Methods> Access Error Method



                                   
AccessError Method
AddToFavorites
BuildCriteria Method
CloseCurrentDatabase
CodeDB
CompactRepair Method
ConvertAccessProject


AccessError Method Example

AccessError Method - You can use the AccessError 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 AccessError 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

Contact Information

Custom Software Development
Microsoft Access 2003 2000 2002(XP) 97 All Windows Versions