Error Handling

R

Ray S.

I remember reading somewhere here a tip about discovering what a particular
error message number means for error handling. Can anyone refresh my memory?
I want to display a message box that gives more information than just a
number.
 
D

Dirk Goldgar

In
Ray S. said:
I remember reading somewhere here a tip about discovering what a
particular error message number means for error handling. Can anyone
refresh my memory? I want to display a message box that gives more
information than just a number.

In the Immediate Window, invoke the AccessError() function. For
example,

?AccessError(3022)
The changes you requested to the table were not successful because
they would create duplicate values in the index, primary key, or
relationship. Change the data in the field or fields that contain
duplicate data, remove the index, or redefine the index to permit
duplicate entries and try again.
 
D

Dirk Goldgar

In
(PeteCresswell) said:
Per Ray S.:

"Error$"?

I understood Ray's question differently -- I thought he just had an
error number, and wanted to be able to look up what it meant. But if
he's involved an active error-handling procedure, he could use Error$ to
get the description, or refer to Err.Number for the number and
Err.Description for the message.
 
D

Douglas J. Steele

Yup. As far as I remember, Error$ has been officially deprecated for many
versions. It's just sticking around for backwards compatibility.
 
Top