D
david epsom dot com dot au
In an MDB, an unhandled error in a form event gets a VB msgbox, with a VBA
error message.
The same unhandled error in an MDE gets an Access msgbox, with an Access
error message.
To my surprise and disgust, the production copy of my database behaves
differently than my development copy.
For those who are interested, I have tested with a simple error in the click
event of the detail section of a form:
Private Sub Detail_Click()
Dim i As Integer
i = i / 0
End Sub
In the MDB version, I get an error message like this:
Microsoft Visual Basic
Run-time error '6':
Overflow
In the MDE version, I get an error message like this:
My Application Name
The expression On Click you entered as the event property setting
produced the following error: Overflow.
The expression may not result in the name of a macro, the name of a user
defined function, or [Event Procedure].
There may have been an error evaluating the function event or macro.
Since the MDE version is an Access MsgBox, the first section of the message
is bold.
Also, although you can't see it in this example, it discards err.description
and uses it's own description of the error.
For comparison: If you use an error handler with a msgbox, you get this:
Microsoft Access
Overflow
Which is Err.Description in a VBA msgbox with the caption incorrectly
supplied by Access.
error message.
The same unhandled error in an MDE gets an Access msgbox, with an Access
error message.
To my surprise and disgust, the production copy of my database behaves
differently than my development copy.
For those who are interested, I have tested with a simple error in the click
event of the detail section of a form:
Private Sub Detail_Click()
Dim i As Integer
i = i / 0
End Sub
In the MDB version, I get an error message like this:
Microsoft Visual Basic
Run-time error '6':
Overflow
In the MDE version, I get an error message like this:
My Application Name
The expression On Click you entered as the event property setting
produced the following error: Overflow.
The expression may not result in the name of a macro, the name of a user
defined function, or [Event Procedure].
There may have been an error evaluating the function event or macro.
Since the MDE version is an Access MsgBox, the first section of the message
is bold.
Also, although you can't see it in this example, it discards err.description
and uses it's own description of the error.
For comparison: If you use an error handler with a msgbox, you get this:
Microsoft Access
Overflow
Which is Err.Description in a VBA msgbox with the caption incorrectly
supplied by Access.