Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / September 2005

Tip: Looking for answers? Try searching our database.

Getting rid of generic warning

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Randy - 08 Sep 2005 16:23 GMT
Access 2000.  I have a table with 3 fields indexed to prevent duplicates.
How do I get rid of the generic warning stating "Duplicate keys" etc.  and
replace it with a custom warning of my choosing?..Thanks
Wayne Morgan - 09 Sep 2005 05:40 GMT
This error can be trapped in the form's Error event. The error number is
3022.

Example:
Private Sub Form_Error(DataErr As Integer, Response As Integer)
Const DUPLICATE_INDEX = 3022
If DataErr = DUPLICATE_INDEX Then
   MsgBox "This exercise is/was previously issued to this trainee.  Please"
& vbCrLf & _
   "select another exercise from this category or press the close form
button."
   Response = acDataErrContinue
End If
End Sub

Signature

Wayne Morgan
MS Access MVP

> Access 2000.  I have a table with 3 fields indexed to prevent duplicates.
> How do I get rid of the generic warning stating "Duplicate keys" etc.  and
> replace it with a custom warning of my choosing?..Thanks
Randy - 09 Sep 2005 21:58 GMT
Thanks Wayne.
> This error can be trapped in the form's Error event. The error number is
> 3022.
[quoted text clipped - 14 lines]
>> How do I get rid of the generic warning stating "Duplicate keys" etc.
>> and replace it with a custom warning of my choosing?..Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.