Customize The Error Message In Access

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sashijagan
    New Member
    • Nov 2008
    • 4

    Customize The Error Message In Access

    I Want To To Customarise Error Messages That Appears In Access While Entring Data In Fields.kindly Adice

    Jagannathan
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    You don't say what you want to do in case an attempt is made to enter a duplicate bill, so we'll use the line

    Me.Undo

    to undo what you've entered. If this is not your intent, simply omit this line from the code below:

    Code:
    Private Sub Form_Error(DataErr As Integer, Response As Integer)
    Dim Message As String
     If DataErr = 3022 Then 'Duplicate Bill entered
      Message = "You Have Attemped to Enter A Duplicate Bill"
      Response = MsgBox(Message, vbExclamation, "Duplicate Bill")
      Response = acDataErrContinue
      Me.Undo
    End If
    End Sub
    Linq ;0)>

    Moderator Note:

    This thread is related to an earlier thread by the OP. The error in question is 3022, attempting to enter a record with Duplicate data in the Primary Key.

    Comment

    Working...