Help with error handling

igr11

New member
Local time
Today, 13:03
Joined
Mar 27, 2008
Messages
3
Hi

I have an access form linked to the main table of my database. The table fields are configured to not accept duplicates. When user enters information into the form that already exists in the database, he/she gets a long error message followed by series of less than helpful dialogs which end in form closure. Let's just say that scenario is not what you would call "graceful."
I would like to program some code that would give the user several options: 1. To be taken to record that already exists and lose all newly-entered info, 2. To be taken back to the form to allow editing of typed info (i.e. to correct a mistake), 3. Allow storage of duplicate record (i.e. two different people with same names).

My knowledge of VB is slim to none. Any help would be greatly appreciated.
Thanks,
Igor
 
The table fields are configured to not accept duplicates.
If the table involved in relationships with other tables?
When user enters information into the form that already exists in the database, he/she gets a long error message followed by series of less than helpful dialogs which end in form closure.
What do they say?
I would like to program some code that would give the user several options: 1. To be taken to record that already exists and lose all newly-entered info, 2. To be taken back to the form to allow editing of typed info (i.e. to correct a mistake), 3. Allow storage of duplicate record (i.e. two different people with same names).
Probably easy enough, but you have to fix the first problem before you do this I think,...
 
Thanks for the reply. I have one major table linked to several other lookup tables. But that's not the problem.

I would essentially like to be able to do the following:
When a name is entered on the main data entry form, on switching to the next field the database should be searched for duplicates automatically. If a duplicate has been found, I would like the user to receive a message giving him an option to 1. Go to the duplicate entry and undo all the information that has been entered into the current record, 2. Continue entering duplication information, 3. Cancel without saving the new record.

Real world example: Let's say the database already contains a patient by the last name "smith." When a new patient named "smith" is entered, a user should be presented with the following message box: The name "Smith" already exists in the database. Do you want to go to the previous record and undo everything you've entered? Do you want to continue with duplicate (in case this is a different "Smith")? Cancel new record.

I hope that is somewhat clear.
Igor
 

Users who are viewing this thread

Back
Top Bottom