UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Reserved Error (-7711); There Is No Message For This Error Upon Entering A Record In The Form, Access 2013    
 
   
Leah
post Feb 14 2018, 12:23 PM
Post#1



Posts: 766
Joined: 22-February 00
From: New York, New York



The user is getting Reserved error (-7711); there is no message for this error upon trying to enter a record in the form. I was able to diagnose what was causing the error, he was trying to enter a duplicate row. The unique index has a number of fields. I figured it out because I made a typo in a field that is part of the index when I tried to replicate the error and then when I tried to fix it and save the record I got the error. That message is not very helpful.

Is there something I can do to fix the table or tables so that the system would give the dup message instead?

Is there a way that I can get a message to advise that it is a duplicate before he enters a bunch of stuff?

Rather not share the database as creating a dummy version is rather a pain.

Thanks

Leah
Go to the top of the page
 
theDBguy
post Feb 14 2018, 01:02 PM
Post#2


Access Wiki and Forums Moderator
Posts: 73,744
Joined: 19-June 07
From: SunnySandyEggo


Hi Leah,

Without seeing your actual setup, I can only offer general suggestions.

To catch validation errors such as when preventing duplicate records, it is often best to use the BeforeUpdate event.

Hope it helps...
Go to the top of the page
 
Leah
post Feb 15 2018, 11:41 AM
Post#3



Posts: 766
Joined: 22-February 00
From: New York, New York


Sounds good. Is there a way to see if a record would be a duplicate before the record is saved or the change is saved?

Leah
Go to the top of the page
 
theDBguy
post Feb 15 2018, 11:50 AM
Post#4


Access Wiki and Forums Moderator
Posts: 73,744
Joined: 19-June 07
From: SunnySandyEggo


Hi,

Yes. If you use the BeforeUpdate event, you can validate the entry to prevent a duplicate record before it is committed into the table (saved). The BeforeUpdate event includes a Cancel argument, which you can use to stop Access from saving an invalid record.
Go to the top of the page
 
projecttoday
post Feb 15 2018, 11:52 AM
Post#5


UtterAccess VIP
Posts: 10,252
Joined: 10-February 04
From: South Charleston, WV


You can use the Dcount function to look for records in the table that meet the condition. If Dcount > 0 then cancel the update.
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    17th November 2018 - 03:47 AM