[AccessD] VBE Error Handler

papparuff at comcast.net papparuff at comcast.net
Tue Mar 23 08:10:33 CST 2004


You can create your own error constant and then when the error occurs, display your own special error message.  Something like this:

Private Sub test()

    Dim i As Integer
    Dim j As Integer
    Dim a As Integer
    ' Error Number is Division by 0 not allowed
    Const DivBy0 = 11
    
    On Error GoTo test_ERR

    i = 1
    j = 0
    a = i / j

test_EXIT:

    Exit Sub

test_ERR:

    If DivBy0 Then
        MsgBox "You cannot divide by 0"
    Else
        MsgBox Error$
    End If
    Resume test_EXIT
    
End Sub



--
John V. Ruff – The Eternal Optimist :-) 

“Commit to the Lord whatever you do, 
    and your plans will succeed.” Proverbs 16:3 
> In short, it is not "programmable".
> 
> The message the user gets is the native Access error plus the function /
> module name.  What did you have in mind?
> 
> John W. Colby
> www.ColbyConsulting.com
> 
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of S D
> Sent: Tuesday, March 23, 2004 8:20 AM
> To: accessd
> Subject: [AccessD] VBE Error Handler
> 
> 
> Hi group,
> 
> i downloaded the VBE Error Handler dll from www.databaseadvisors written by
> John Colby. I really love this program....almost.
> 
> It works great however I want to change the message that the user gets. Is
> that possible?
> 
> Thnx in advance.
> 
> Regards
> 
> Sander
> 
> Do you Yahoo!?
> Yahoo! Finance Tax Center - File online. File on time.
> --
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 
> 
> 
> -- 
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com



More information about the AccessD mailing list