By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,827 Members | 2,220 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,827 IT Pros & Developers. It's quick & easy.

Customize The Error Message In Access

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

Jagannathan
Nov 5 '08 #1
Share this Question
Share on Google+
1 Reply


missinglinq
Expert 2.5K+
P: 3,532
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:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Error(DataErr As Integer, Response As Integer)
  2. Dim Message As String
  3.  If DataErr = 3022 Then 'Duplicate Bill entered
  4.   Message = "You Have Attemped to Enter A Duplicate Bill"
  5.   Response = MsgBox(Message, vbExclamation, "Duplicate Bill")
  6.   Response = acDataErrContinue
  7.   Me.Undo
  8. End If
  9. 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.
Nov 5 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.