Custom Error Message (1 Viewer)

gnarpeggio

Registered User.
Local time
Yesterday, 21:57
Joined
Jun 22, 2010
Messages
74
Hello,

I'm trying to create a custom error message for my database. I'm not too experienced with doing this, so hopefully I can get some help.

I have a TotalAmount field that needs to needs to match the exact currency input as the amount field in another table. I need to create a code for a prompt that will tell the user that the total amount is incorrect if they enter the wrong amount.

Please let me know if you can assist me in this process and if you need a better description of my problem.

Thank you!
 

SOS

Registered Lunatic
Local time
Yesterday, 21:57
Joined
Aug 27, 2008
Messages
3,517
If the information is being input using a form then that can be done. If not, it can't. So, are you using a form for entering the information?
 

gnarpeggio

Registered User.
Local time
Yesterday, 21:57
Joined
Jun 22, 2010
Messages
74
The information being entered will be located on a form. I'm just not too good at setting up the syntax for an error message. I'm also confused as to which event procedure I need to have it run on (AfterUpdate, OnExit, etc.)
 

SOS

Registered Lunatic
Local time
Yesterday, 21:57
Joined
Aug 27, 2008
Messages
3,517
You would use the form's BEFORE UPDATE event and you cancel that if it fails.

But now that I read this again, I am wondering why you are attempting to store the same information more than once. That usually indicates a flawed database design (usually around normalization issues). Why are you trying to have them input the same value that is already there?
 

gnarpeggio

Registered User.
Local time
Yesterday, 21:57
Joined
Jun 22, 2010
Messages
74
The unit that enters this information is requiring this as a "business rule", therefore I have to make a required prompt. I figured that using a lookup function would suffice, but they've specifically asked me to do this.

I've created a separate table for the data that they will need to enter. One related batch number from the main table will pull up the set of records they are looking for, and they will assign two unique numbers on their end (referred to as RC and CID numbers). The batch number will serve as a record on their end, meaning that these RC and CID numbers will be assigned to only one batch number from the main table.

I hope this is making sense.
 

Users who are viewing this thread

Top Bottom