Errormessage

Vallan

Registered User.
Local time
Today, 15:07
Joined
Jan 16, 2008
Messages
46
Hello.

I have made a table wich makes 3 fields to one index.

you cant write the same text twice in these without an error saying there are aldready one of these in the database.

I wonder if its possible to personalize the errormessage so the users can understand it better that access errorcoding.


Hope you unsderstand my question.

Mattias
 
one way, is to use the forms onerror event to intercept error messages

msgbox("Error: " & err & " Desc: " & err.description)

will show you the native message

use a case statement to change the ones you want selectively.

--------
alternatively, in the form's before update event, or each fields before update event, to do whatever validation you need, and manage the data entry BEFORE any errors are
thrown.
 
Hi tried your way.

It generated a popup box with


Error: 0 Desc:


After i click ok i come to the ordinary error message.


Sorry im a beginner in this.

Can you give me advice?

Mattias
 
if its popping up 0, then there is no error, so i can't see why the error handler is being called

anyway, the msgbox was just so you could see the error
instead of this you now need a case statement

Code:
select case err
case 0: 'do nothing
    response = acdataerrcontinue
case 8858: 'say this is the error you are tring to change
    msgbox("you have done sonmething or other ...")
    response = acdataerrcontinue
end select

the way you set the response determines what access does. setting respons = acdataerrcontinue tells access you have processed the error, so it doesnt need to give you its normal error message

instead you have provided your custom message

hope this helps
 
Sorry.

Maybe it was wrong to call it error message.


The message that pops up is to tell you that there woul be a double insertion with the input you are making now.

They cant make 2 things of the same.

its a foodorderingsystem so i made an index so they cant make the same order twice.


Hope this is a better explanation.

Mattias
 
yes

you can intercept this (or any other) error message, with the forms on error event, and replace it with your own. the access message corresponds to a particular error code, which you need ot know to intercept the message

Standard access errors show the message, but not the error number, which makes it fiddly tracking down the error number
 

Users who are viewing this thread

Back
Top Bottom